摘要: 今天写一个demo,要用到鼠标键盘控制三维视角,因此写了个脚本用于控制。该脚本可以用于即时战略类游戏的视角,提供了缩进,拉伸,旋转。同时按住鼠标右键不放,移动鼠标可以实现第一人称视角的效果。 1 using UnityEngine; 2 using System.Collections; 3 4 ... 阅读全文
posted @ 2015-01-16 20:43 H5开发技术 阅读(15887) 评论(0) 推荐(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开发技术 阅读(209) 评论(0) 推荐(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开发技术 阅读(208) 评论(0) 推荐(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开发技术 阅读(252) 评论(0) 推荐(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开发技术 阅读(328) 评论(0) 推荐(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开发技术 阅读(133) 评论(0) 推荐(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开发技术 阅读(160) 评论(0) 推荐(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开发技术 阅读(158) 评论(0) 推荐(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开发技术 阅读(191) 评论(0) 推荐(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开发技术 阅读(174) 评论(0) 推荐(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开发技术 阅读(151) 评论(0) 推荐(0)
摘要: Wildcard MatchingImplement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters... 阅读全文
posted @ 2015-01-10 21:41 H5开发技术 阅读(164) 评论(0) 推荐(0)
摘要: Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the follow... 阅读全文
posted @ 2015-01-10 16:49 H5开发技术 阅读(124) 评论(0) 推荐(0)
摘要: Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen... 阅读全文
posted @ 2015-01-09 21:31 H5开发技术 阅读(192) 评论(0) 推荐(0)
摘要: Rotate ImageYou are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?假设旋转的时候... 阅读全文
posted @ 2015-01-09 20:20 H5开发技术 阅读(147) 评论(0) 推荐(0)
摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions. 1 class Solutio... 阅读全文
posted @ 2015-01-09 18:37 H5开发技术 阅读(131) 评论(0) 推荐(0)
摘要: N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all... 阅读全文
posted @ 2015-01-09 18:30 H5开发技术 阅读(183) 评论(0) 推荐(0)
摘要: Insert IntervalGiven a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals... 阅读全文
posted @ 2015-01-09 16:30 H5开发技术 阅读(156) 评论(0) 推荐(0)
摘要: Spiral Matrix IIGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the... 阅读全文
posted @ 2015-01-08 20:25 H5开发技术 阅读(126) 评论(0) 推荐(0)
摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文
posted @ 2015-01-07 23:29 H5开发技术 阅读(191) 评论(0) 推荐(0)
摘要: Merge IntervalsGiven 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]... 阅读全文
posted @ 2015-01-07 21:56 H5开发技术 阅读(154) 评论(0) 推荐(0)
摘要: Regular Expression MatchingImplement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more o... 阅读全文
posted @ 2015-01-07 21:18 H5开发技术 阅读(189) 评论(0) 推荐(0)
摘要: Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−... 阅读全文
posted @ 2015-01-05 20:08 H5开发技术 阅读(218) 评论(0) 推荐(0)
摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文
posted @ 2015-01-05 15:13 H5开发技术 阅读(157) 评论(0) 推荐(0)
摘要: Unique Paths IITotal Accepted:22828Total Submissions:81414My SubmissionsFollow up for "Unique Paths":Now consider if some obstacles are added to the g... 阅读全文
posted @ 2015-01-05 14:27 H5开发技术 阅读(173) 评论(0) 推荐(0)
摘要: Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a... 阅读全文
posted @ 2015-01-04 22:56 H5开发技术 阅读(188) 评论(0) 推荐(0)
摘要: Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =... 阅读全文
posted @ 2015-01-04 21:13 H5开发技术 阅读(143) 评论(0) 推荐(0)
摘要: Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文
posted @ 2015-01-04 20:39 H5开发技术 阅读(191) 评论(0) 推荐(0)
摘要: Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文
posted @ 2015-01-04 18:53 H5开发技术 阅读(209) 评论(0) 推荐(0)
摘要: Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substr... 阅读全文
posted @ 2015-01-03 21:04 H5开发技术 阅读(141) 评论(0) 推荐(0)
摘要: Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, wh... 阅读全文
posted @ 2015-01-03 19:31 H5开发技术 阅读(179) 评论(0) 推荐(0)
摘要: Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字的组数规则,有几条须注意掌握;(1)基本数字Ⅰ、... 阅读全文
posted @ 2015-01-03 17:11 H5开发技术 阅读(178) 评论(0) 推荐(0)
摘要: First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo... 阅读全文
posted @ 2015-01-03 16:35 H5开发技术 阅读(136) 评论(0) 推荐(0)
摘要: Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You... 阅读全文
posted @ 2015-01-03 16:06 H5开发技术 阅读(203) 评论(0) 推荐(0)
摘要: Container With Most WaterGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such t... 阅读全文
posted @ 2015-01-03 15:05 H5开发技术 阅读(149) 评论(0) 推荐(0)
摘要: Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return... 阅读全文
posted @ 2015-01-03 12:19 H5开发技术 阅读(169) 评论(0) 推荐(0)
摘要: Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tr... 阅读全文
posted @ 2015-01-03 11:37 H5开发技术 阅读(158) 评论(0) 推荐(0)
摘要: Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be... 阅读全文
posted @ 2015-01-03 11:20 H5开发技术 阅读(140) 评论(0) 推荐(0)
摘要: Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"255255... 阅读全文
posted @ 2015-01-03 10:52 H5开发技术 阅读(184) 评论(0) 推荐(0)
摘要: Binary Search Tree IteratorImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callin... 阅读全文
posted @ 2015-01-01 16:40 H5开发技术 阅读(193) 评论(0) 推荐(0)