上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页
摘要: 题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3 阅读全文
posted @ 2016-02-27 23:08 wxquare 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目: Reverse a singly linked list. cpp: class Solution { public: ListNode* reverseList(ListNode* head) { if(!head || !head->next) return head; ListNode 阅读全文
posted @ 2016-02-27 23:02 wxquare 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> A 阅读全文
posted @ 2016-02-27 11:15 wxquare 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. c 阅读全文
posted @ 2016-02-26 23:40 wxquare 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 通过c++字符串string实现大数的加、减、乘、除 阅读全文
posted @ 2016-02-25 11:51 wxquare 阅读(1437) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non 阅读全文
posted @ 2016-02-25 11:45 wxquare 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题意: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or anoth 阅读全文
posted @ 2016-02-24 16:34 wxquare 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 二叉查找树(Binary Search Tree)是满足如下性质的二叉树:①若它的左子树非空,则左子树上所有结点的值均小于根结点的值;②若它的右子树非空,则右子树上所有结点的值均大于根结点的值;③左、右子树本身又各是一棵二叉查找树。 通俗的讲,二叉查找树的左子树上的结点不比父结点大,右子树上的结点不 阅读全文
posted @ 2016-02-23 23:22 wxquare 阅读(568) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. cpp: class Solution { public: TreeNode* sortedArrayT 阅读全文
posted @ 2016-02-23 22:59 wxquare 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目:计算完全二叉树的节点数目(二分法) Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary 阅读全文
posted @ 2016-02-22 23:21 wxquare 阅读(198) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页