- 博客(41)
- 资源 (1)
- 收藏
- 关注
原创 [Unity3D]Unity中的Time
要求实现动态生成管道,一直没有想到比较好的方法,跟着教程做的时候也用到了Time类,这次又详细查了查。1.Time.time此帧开始的时间(只读)。这是以秒计算到游戏开始的时间。也就是说,从游戏开始到到现在所用的时间。当在MonoBehaviour的FixedUpdate里调用的时候,返回的是fixedTime属性。// Instantiates a projectile
2015-04-15 14:02:56 1124
原创 [LeetCode OJ]Insertion Sort List
Sort a linked list using insertion sort.链表实现插入排序,遇到链表的问题总是很蒙圈,都要想 好久。/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x)
2015-01-19 21:05:03 554
原创 [LeetCode OJ]Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each
2015-01-19 21:03:07 552
原创 [LeetCode OJ]Find Minimum 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).Find the minimum element.You may assume no duplicate exists in the arra
2014-12-27 10:33:05 548
原创 [LeetCode OJ]Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one
2014-11-26 21:09:43 531
原创 [LeetCode OJ]Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d
2014-11-26 21:08:07 432
原创 [LeetCode OJ]Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; *
2014-11-25 21:53:21 479
原创 [LeetCode OJ]Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"
2014-11-25 21:32:03 539
原创 [LeetCode OJ]Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).思路1:第一行变第一列,第二行变第二列,额外申请一个数组空间。class Solution {public: void rotate(vector > &matrix
2014-11-25 21:27:16 524
原创 [LeetCode OJ]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 subarray [4,−1,2,1]
2014-11-23 14:16:54 537
原创 [LeetCode OJ]Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0,
2014-11-20 20:49:33 559
原创 [LeetCode OJ]Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence o
2014-11-20 20:16:52 566
原创 [LeetCode OJ]Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space.
2014-11-17 20:08:06 465
原创 [LeetCode OJ]Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the
2014-11-05 21:48:02 471
原创 [LeetCode OJ]Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive soluti
2014-11-05 21:45:30 349
原创 [LeetCode OJ]Unique Binary Search Trees
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1
2014-11-05 20:57:49 446
原创 [LeetCode OJ]Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe
2014-11-02 20:54:16 588
原创 [LeetCode OJ]Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end,
2014-11-02 20:43:29 475
原创 [LeetCode OJ]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 0.Note: A word is d
2014-11-02 20:39:39 447
原创 [LeetCode OJ]Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.这个最小深度的gai
2014-11-02 19:17:38 399
原创 [LeetCode OJ]Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. I
2014-11-02 18:58:33 396
原创 [LeetCode OJ]Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].
2014-11-02 18:55:22 434
原创 [LeetCode OJ]Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3,2].
2014-11-02 18:50:06 389
原创 [LeetCode OJ]Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.
2014-10-22 19:16:27 443
原创 [LeetCode OJ]Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?蛮有意思的yidaot
2014-10-21 21:37:06 469
原创 [LeetCode OJ]Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.感觉这道题对自己的帮助haishi
2014-10-21 21:20:57 453
原创 [LeetCode OJ]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 no duplicates in the array.
2014-10-21 21:15:59 499
原创 [LeetCode OJ]Roman to Integer
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.
2014-10-21 20:34:07 527
原创 [LeetCode OJ]Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
2014-10-17 19:21:47 451
原创 [LeetCode OJ]Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2014-10-17 19:10:46 441
原创 [LeetCode OJ]Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.
2014-10-16 20:30:14 403
原创 [LeetCode OJ]Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
2014-10-16 19:43:36 549
原创 [LeetCode OJ]Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from
2014-10-16 18:56:08 550
原创 [LeetCode OJ]Single number II
Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usi
2014-10-14 20:12:14 548
原创 [Android]Android FTP server based on Apache FTPServer
老板让做的用Android做热点,同时作为FTPfuw
2014-09-25 19:01:14 2228 1
原创 [LeetCode OJ]Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321这个开始的时候就想要用一个flag,
2014-09-25 18:59:58 475
原创 [LeetCode OJ]Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
2014-09-24 20:48:34 450
原创 [LeetCode OJ]Maximum Depth Of Binary Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.貌似就是个二叉树
2014-09-23 20:03:35 642
原创 [LeetCode OJ]Single Number
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e
2014-09-23 18:39:59 1009
Mega-Fiers v2.74
2015-04-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人