摘要:
Intersection of Two Linked ListsWrite a program to find the node at which the intersection of two singly linked lists begins.For example, the followin...
阅读全文
posted @ 2015-01-26 23:29
H5开发技术
阅读(244)
推荐(0)
摘要:
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
阅读全文
posted @ 2015-01-26 23:28
H5开发技术
阅读(185)
推荐(0)
摘要:
Word LadderTotal Accepted:24823Total Submissions:135014My SubmissionsGiven two words (startandend), and a dictionary, find the length of shortest tran...
阅读全文
posted @ 2015-01-26 23:27
H5开发技术
阅读(224)
推荐(0)
摘要:
Search Insert PositionGiven 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 ...
阅读全文
posted @ 2015-01-26 23:26
H5开发技术
阅读(164)
推荐(0)
摘要:
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...
阅读全文
posted @ 2015-01-26 23:25
H5开发技术
阅读(223)
推荐(0)
摘要:
Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre...
阅读全文
posted @ 2015-01-26 23:24
H5开发技术
阅读(184)
推荐(0)
摘要:
Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".Hide TagsMathString先补全字符串,从末尾开始加,每次计算...
阅读全文
posted @ 2015-01-26 23:23
H5开发技术
阅读(133)
推荐(0)
摘要:
Search a 2D MatrixWrite an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row...
阅读全文
posted @ 2015-01-26 23:22
H5开发技术
阅读(218)
推荐(0)
摘要:
Find Peak ElementA peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and ...
阅读全文
posted @ 2015-01-26 23:21
H5开发技术
阅读(146)
推荐(0)
摘要:
Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to...
阅读全文
posted @ 2015-01-26 23:20
H5开发技术
阅读(168)
推荐(0)
摘要:
Compare Version NumbersCompare two version numbersversion1andversion1.Ifversion1>version2return 1, ifversion1 22; return 1.Example2: version1=="11.22....
阅读全文
posted @ 2015-01-26 23:19
H5开发技术
阅读(228)
推荐(0)
摘要:
AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Anagrams:即字母个数和字母都相同,但是字母顺序不相...
阅读全文
posted @ 2015-01-26 23:18
H5开发技术
阅读(207)
推荐(0)
摘要:
ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i...
阅读全文
posted @ 2015-01-26 23:17
H5开发技术
阅读(143)
推荐(0)
摘要:
Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac...
阅读全文
posted @ 2015-01-24 15:20
H5开发技术
阅读(268)
推荐(0)
摘要:
Median of Two Sorted ArraysThere are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run...
阅读全文
posted @ 2015-01-24 15:19
H5开发技术
阅读(161)
推荐(0)
摘要:
Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ...
阅读全文
posted @ 2015-01-24 15:17
H5开发技术
阅读(161)
推荐(0)
摘要:
Word Ladder IIGiven two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter ...
阅读全文
posted @ 2015-01-21 22:21
H5开发技术
阅读(155)
推荐(0)
摘要:
Surrounded RegionsGiven a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that...
阅读全文
posted @ 2015-01-21 20:46
H5开发技术
阅读(224)
推荐(0)
摘要:
Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the ...
阅读全文
posted @ 2015-01-20 21:42
H5开发技术
阅读(260)
推荐(0)
摘要:
Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.使用dpHeight[]数组来记...
阅读全文
posted @ 2015-01-20 19:57
H5开发技术
阅读(188)
推荐(0)
摘要:
Invoke和InvokeRepeating方法,可以实现延迟调用,和周期调用第一个是执行一次,第二个是重复执行void Invoke(string methodName, float time);第一个参数是方法名(注意是字符串形式),并不是更方便的委托。第二个是延时多少秒。只执行一次。void ...
阅读全文
posted @ 2015-01-19 22:35
H5开发技术
阅读(1341)
推荐(0)
摘要:
Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
阅读全文
posted @ 2015-01-19 22:25
H5开发技术
阅读(202)
推荐(0)
摘要:
Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the tot...
阅读全文
posted @ 2015-01-19 22:23
H5开发技术
阅读(196)
推荐(0)
摘要:
Fraction to Recurring DecimalGiven two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the ...
阅读全文
posted @ 2015-01-18 20:16
H5开发技术
阅读(202)
推荐(0)
摘要:
在Unity3D中,有时候我们需要计算二维向量的夹角。二维向量夹角一般在0~180度之前,可以直接调用Vector2.Angle(Vector2 from, Vector2 to)来计算。但是在有些场景,我们需要-180~180度的夹角,此时可以用下面的脚本进行计算:1 float Vect...
阅读全文
posted @ 2015-01-18 18:40
H5开发技术
阅读(14107)
推荐(0)
摘要:
Partition ListGiven a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should pres...
阅读全文
posted @ 2015-01-18 18:34
H5开发技术
阅读(234)
推荐(0)
摘要:
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
阅读全文
posted @ 2015-01-18 16:58
H5开发技术
阅读(156)
推荐(0)
摘要:
Word Break IIGiven a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all...
阅读全文
posted @ 2015-01-17 21:28
H5开发技术
阅读(176)
推荐(0)
摘要:
Substring with Concatenation of All WordsYou are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices o...
阅读全文
posted @ 2015-01-16 22:59
H5开发技术
阅读(219)
推荐(0)
摘要:
今天写一个demo,要用到鼠标键盘控制三维视角,因此写了个脚本用于控制。该脚本可以用于即时战略类游戏的视角,提供了缩进,拉伸,旋转。同时按住鼠标右键不放,移动鼠标可以实现第一人称视角的效果。 1 using UnityEngine; 2 using System.Collections; 3 4 ...
阅读全文
posted @ 2015-01-16 20:43
H5开发技术
阅读(15856)
推荐(0)
摘要:
Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A sol...
阅读全文
posted @ 2015-01-15 22:57
H5开发技术
阅读(207)
推荐(0)
摘要:
Dungeon GameThe demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms l...
阅读全文
posted @ 2015-01-15 22:06
H5开发技术
阅读(201)
推荐(0)
摘要:
Text JustificationGiven an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) just...
阅读全文
posted @ 2015-01-14 22:44
H5开发技术
阅读(245)
推荐(0)
摘要:
Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the larg...
阅读全文
posted @ 2015-01-13 21:05
H5开发技术
阅读(324)
推荐(0)
摘要:
Merge k Sorted ListsMergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.采用优先队列priority_queue把ListNode放入优先队...
阅读全文
posted @ 2015-01-12 23:03
H5开发技术
阅读(132)
推荐(0)
摘要:
Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a...
阅读全文
posted @ 2015-01-12 21:32
H5开发技术
阅读(156)
推荐(0)
摘要:
Multiply StringsGiven two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large ...
阅读全文
posted @ 2015-01-11 20:33
H5开发技术
阅读(156)
推荐(0)
摘要:
Unique Binary Search Trees IIGivenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your pr...
阅读全文
posted @ 2015-01-11 14:28
H5开发技术
阅读(189)
推荐(0)
摘要:
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
阅读全文
posted @ 2015-01-11 13:39
H5开发技术
阅读(165)
推荐(0)
摘要:
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.每次把中间元素当成根节...
阅读全文
posted @ 2015-01-11 11:17
H5开发技术
阅读(150)
推荐(0)