- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 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.answer:b
2015-10-14 17:35:48
225
原创 Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value
2015-10-14 16:58:43
196
原创 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.解题:int maxDepth(TreeNode* root)
2015-10-14 14:11:36
163
原创 Add Digits
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like:3 + 8 = 11, 1 + 1 = 2. Since 2 has only one
2015-10-13 15:52:21
209
原创 Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the
2015-10-13 15:46:37
216
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人