- 博客(77)
- 资源 (8)
- 收藏
- 关注
原创 cocos2dx中Action的Tag设置问题
cocos2dx中Action的Tag要在runAction之后再设置,否则不管用。例如:action:setTag(1)sprite:runAction(action)这个时候使用sprite:getActionByTag(1)获取到的值为nil而如果这样写,即把setTag写在runAction之后,就可以正常获取了:sprite:runAction(a
2015-03-07 17:19:27 855
原创 Cocos2dx 3.x 添加触摸事件监听器
cocos2dx 中Layer的setTouchEnabled已经被淘汰,取而代之的是用户自己设定监听器。 auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesBegan = [&](const std::vector& touches, Event *unused_eve
2015-01-28 14:51:30 735
原创 [LeetCode]Sqrt(x)
Implement int sqrt(int x).Compute and return the square root of x.
2014-09-25 14:54:47 167
原创 [LeetCode]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-09-17 16:28:38 114
原创 [LeetCode]GrayCode
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 of
2014-09-17 16:17:33 163
原创 [LeetCode]Subset I/II
Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For exa
2014-09-16 10:19:11 172
原创 [LeetCode]Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", ret
2014-09-10 00:19:13 142
原创 [LeetCode]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 f
2014-09-08 16:05:50 142
原创 [LeetCode]Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.递归。/** * Definition for singly-linked list. * struct ListNode { * int val; *
2014-09-08 15:28:11 175
原创 [LeetCode]Populating Next Right Pointers in Each Node II
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant
2014-09-08 00:36:29 97
原创 [LeetCode]Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2014-09-07 23:22:26 88
原创 [LeetCode]Word Ladder II
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be changed at a timeEach intermediate word must exi
2014-09-07 23:07:09 102
原创 [LeetCode]Word Ladder
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m
2014-09-07 20:47:48 108
原创 [LeetCode]Surrounded Regions
Given 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 surrounded region.For example,X X X XX O O X
2014-09-07 18:44:57 92
原创 [LeetCode]Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return
2014-09-07 16:36:34 96
原创 [LeetCode]Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to
2014-09-07 14:36:09 64
原创 [LeetCode]Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on
2014-09-06 23:03:58 100
原创 [LeetCode]Best Time to Buy and Sell Stock I/II/III
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),
2014-09-06 19:51:02 95
原创 [LeetCode]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-09-06 15:51:45 92
原创 [LeetCode]Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list. 写了几遍都是rum
2014-09-05 23:50:16 90
原创 [LeetCode]Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "
2014-09-05 19:17:52 101
原创 [LeetCode]Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"
2014-09-05 17:26:44 85
原创 [LeetCode]Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?设经过x
2014-09-05 00:26:01 93
原创 [LeetCode]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?
2014-09-04 23:37:53 83
原创 [LeetCode]Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to
2014-09-04 23:24:52 82
原创 [LeetCode]Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary
2014-09-04 21:16:55 88
原创 [LeetCode]Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
2014-09-04 20:58:59 81
原创 [LeetCode]Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.
2014-09-04 20:53:59 158
原创 [LeetCode]Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.
2014-09-04 20:47:04 108
原创 [LeetCode]Balanced 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./** * Definition for binary t
2014-09-04 20:19:58 131
原创 [LeetCode]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.设f(n)表示以n为根节点的二叉树到
2014-09-04 20:01:11 86
原创 [LeetCode]Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1
2014-09-04 19:48:52 74
原创 [LeetCode]Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.
2014-09-04 17:37:03 102
原创 [LeetCode]Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20
2014-09-04 16:16:32 86
原创 [LeetCode]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].Note: Recursive solutio
2014-09-04 14:42:48 196
原创 [LeetCode]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].Note: Recursive soluti
2014-09-04 14:24:59 91
原创 [LeetCode]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 solut
2014-09-04 00:00:40 81
原创 [LeetCode]LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if
2014-09-03 23:26:28 88
原创 [LeetCode]Sort List
Sort a linked list in O(n log n) time using constant space complexity.
2014-09-03 20:33:34 115
基于SVM与BoW的图片分类的OpenCV实现
2013-08-06
wii fit (balance board)开发lib库.h文件及dll(C++ for Win)
2010-12-01
Biokey SDK 3.8 标准版 + 驱动程序
2010-03-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人