Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-06-28 22:31:11
阅读次数:
323
题目链接 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k t...
分类:
其他好文 时间:
2014-06-28 21:12:46
阅读次数:
211
Reorder ListGiven a singly linked listL: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' val...
分类:
其他好文 时间:
2014-06-28 20:42:16
阅读次数:
265
1- "原地"排序-转换后替换>>> list = [2,1,3]>>> list.sort()>>> list[1, 2, 3]降序 reverse = True>>> list.sort(reverse = True)>>> list[3, 2, 1, 1]2- "复制"排序-转换然后返回>>>...
分类:
编程语言 时间:
2014-06-28 20:04:47
阅读次数:
299
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 ...
分类:
其他好文 时间:
2014-06-28 14:31:12
阅读次数:
201
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-28 13:23:40
阅读次数:
150
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./** * Def...
分类:
其他好文 时间:
2014-06-21 07:55:42
阅读次数:
197
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not...
分类:
其他好文 时间:
2014-06-21 06:40:07
阅读次数:
172
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No...
分类:
其他好文 时间:
2014-06-21 06:31:43
阅读次数:
265
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-06-20 19:37:40
阅读次数:
136