自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

大气人生

点滴星沙,能塑之,能扬之,方成沙海

  • 博客(64)
  • 收藏
  • 关注

原创 GAN中判别器与极大似然估计的关联

在GAN中,对于判别器D来说,实际上就是一个普通的二分类问题

2017-03-31 01:55:16 5263 1

原创 利用IntelliJ IDEA与Maven开始你的Scala之旅

一. IntelliJ IDEA安装及配置1.1 IntelliJ IDEA下载及安装  首先在 CHOOSE YOUR EDITION 这里选择Community版本,这个版本是免费提供的,对我们的Spark使用来说,用这个版本已经足够了。如下图所示:  直接点击黑色的 DOWNLOAD 按钮会默认开始下载Windows版本的IntelliJ IDEA,如果需要其他平台的版本,可以点击旁边的 .E

2016-10-23 00:07:25 23239 19

原创 Spark在Windows下的环境搭建

由于Spark是用Scala来写的,所以Spark对Scala肯定是原生态支持的,因此这里以Scala为主来介绍Spark环境的搭建,主要包括四个步骤,分别是:JDK的安装,Scala的安装,Spark的安装,Hadoop的下载和配置。为了突出”From Scratch”的特点(都是标题没选好的缘故),所以下面的步骤稍显有些啰嗦,老司机大可不必阅读,直接跳过就好。

2016-10-19 23:40:21 132647 65

原创 最短路径

最短路径问题对于如下的图来说,每一个“∙\bullet”代表一个节点,节点与节点之间是他们之间相应的边权,由于这个图类似于矩阵的形式,所以当给定坐标(x1,y1)和(x2,y2)(x_1, y_1)和(x_2, y_2)时,求这两个节点之间的最短路径。在下面这个图中,最原始的图应该是每条边代表转移概率,这里将概率乘以10取整后得到,也就是每个节点相连边的权值和为10.∙−5−∙−4−∙−4−∙−

2015-08-15 11:03:47 1090

原创 Leetcode65 Plus One

Plus One Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list.Solution1pu

2015-08-12 23:36:18 526

原创 Leetcode64 Minimum Path Sum

Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move eit

2015-08-12 23:09:36 526

原创 Leetcode63 Unique Paths II

Unique Paths II Follow up for “Unique Paths”: Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 r

2015-08-12 22:38:57 357

原创 Leetcode62 Unique Paths

Unique Paths A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is tryi

2015-08-12 19:35:09 454

原创 Leetcode61 Rotate List

Rotate List Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL.Solution利用两个指针定位

2015-08-10 13:37:47 346

原创 Leetcode60 Permutation Sequence

Permutation Sequence The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):"1

2015-08-10 13:09:05 443

原创 Leetcode59 Spiral Matrix II

Spiral Matrix II Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the following matrix:[ [ 1,

2015-08-10 11:12:08 419

原创 Leetcode58 Length of Last Word

Length of Last Word Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. If the last word does not exist, return

2015-08-10 10:29:14 419

原创 Leetcode57 Insert Interval

Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to thei

2015-08-10 01:39:20 445

原创 Leetcode56 Merge Intervals

Merge Intervals Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].Solution将所有的interval按照起点进行排序,

2015-08-09 23:12:31 617

原创 Leetcode55 Jump Game

Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position.

2015-08-09 22:28:49 415

原创 Leetcode54 Spiral Matrix

Spiral Matrix  Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ],

2015-08-09 21:57:49 370

原创 Leetcode53 Maximum Subarray

Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous

2015-08-09 17:18:49 426

原创 Leetcode52 N-Queens II

N-Queens II Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions.Solution在上一题的基础上,这道题显得过于简单。public class Solution {

2015-08-09 16:51:14 330

原创 Leetcode51 N-Queens

N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-que

2015-08-09 16:35:39 391

原创 Leetcode50 Pow(x, n)

Pow(x, n) Implement pow(x, n).Solution1最简单的方法当然就是按照幂运算的规则一个一个去乘方了。如下:public class Solution { public double myPow(double x, int n) { if(x>-0.000001&&x<0.000001) return 0; if(n==

2015-08-09 15:41:34 625

原创 Leetcode49 Anagrams

Anagrams Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case.Solution1这道题是用来找到字符串数组中的所有由相同字符(个数也相同)构成的字符串,例如[“ate”,”and”,”dna”,”dd

2015-08-09 13:56:53 359

原创 Leetcode48 Rotate Image

Rotate Image You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).Solution1这道题无非是一些边界条件的把握。public class Solution { public void rotate(int[][]

2015-08-08 18:35:19 357

原创 Leetcode47 Permutations II

Permutations II Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: [1,1,2],

2015-08-08 01:41:51 341

原创 Leetcode46 Permutations

Permutations Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]

2015-08-07 23:58:19 415

原创 Leetcode45 Jump Game II

Jump Game II Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position

2015-08-07 23:20:24 327

原创 Leetcode44 Wildcard Matching

Wildcard Matching Implement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’ Matches any single character. ‘*’ Matches any sequence of characters (including the empty sequence).

2015-08-07 12:10:25 417

原创 Leetcode43 Multiply Strings

Multiply Strings Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative.Solution1最简单的方法就是完全

2015-08-06 15:12:26 695

原创 Leetcode42 Trapping Rain Water

Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given

2015-08-06 10:18:12 345

原创 Leetcode41 First Missing Positive

First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should ru

2015-08-05 17:59:26 440

原创 Leetcode40 Combination Sum II

Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used

2015-08-05 16:22:47 415

原创 Leetcode39 Combination Sum

Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from

2015-07-30 11:30:29 323

原创 Leetcode38 Count and Say

Count and Say The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 2

2015-07-29 15:37:40 303

原创 Leetcode37 Sudoku Solver

Sudoku Solver Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character ‘.’. You may assume that there will be only one unique solution

2015-07-29 14:25:59 378

原创 Leetcode36 Valid Sudoku

Valid Sudoku Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’. No

2015-07-29 11:42:13 358

原创 Leetcode35 Search Insert Position

Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume n

2015-07-28 19:11:49 306

原创 Leetcode34 Search for a Range

Search for a Range Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(log n). If

2015-07-28 18:34:48 308

原创 Leetcode33 Search in Rotated Sorted Array

Search in Rotated Sorted Array Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to s

2015-07-28 10:30:53 303

原创 Leetcode32 Longest Valid Parentheses

Longest Valid Parentheses Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(()”, the longest valid parent

2015-07-28 01:42:58 297

原创 Leetcode31 Next Permutation

Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as

2015-07-28 00:25:17 348

原创 Leetcode28 Implement strStr()

Implement strStr() Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Solution1最简单的方法当然是一个一个字符去匹配。代码如下:public class

2015-07-27 22:44:38 276

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除