摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2014-11-15 22:33 Jessica程序猿 阅读(186) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2014-11-15 20:53 Jessica程序猿 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort.C++代码如下:#include#includeusing namespace std;//Definition for singly-linked list.struct ListNode{ int val; ... 阅读全文
posted @ 2014-11-15 20:08 Jessica程序猿 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 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 an... 阅读全文
posted @ 2014-11-15 17:22 Jessica程序猿 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa... 阅读全文
posted @ 2014-11-15 17:03 Jessica程序猿 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2... 阅读全文
posted @ 2014-11-15 16:47 Jessica程序猿 阅读(196) 评论(0) 推荐(0) 编辑
摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2014-11-15 15:30 Jessica程序猿 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som... 阅读全文
posted @ 2014-11-15 12:38 Jessica程序猿 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2014-11-15 11:03 Jessica程序猿 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... 阅读全文
posted @ 2014-11-15 08:55 Jessica程序猿 阅读(153) 评论(0) 推荐(0) 编辑