PikachuBLOG


  • 首页

  • 分类

  • 归档

  • 标签

  • 搜索

150. Evaluate Reverse Polish Notation

发表于 2017-08-24 | 分类于 LeetCode | 阅读次数
字数统计 543 | 阅读时长 2

Evaluate the value of an arithmetic expression in Reverse Polish Notation.

Valid operators are + , -, *, / .Each operand may be an integer or another expression.

Some examples :
[“2”, “1”, “+”, “3”, ““] -> ((2 + 1) 3) -> 9
[“4”, “13”, “5”, “/“, “+”] -> (4 + (13 / 5)) -> 6

阅读全文 »

149. Max Points on a Line

发表于 2017-08-24 | 分类于 LeetCode | 阅读次数
字数统计 837 | 阅读时长 4

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

题意:

  在二维平面上给定n个坐标点,找落在同一条直线上点的个数,并找出落在同一直线上点最多的个数。

阅读全文 »

148. Sort List

发表于 2017-08-24 | 分类于 LeetCode | 阅读次数
字数统计 1,122 | 阅读时长 5

Sort a linked list in O(n log n) time using constant space complexity.

题意:

  在 O(n log n)的时间复杂度内,在恒定的空间复杂度内,排序单链表。

阅读全文 »

147. Insertion Sort List

发表于 2017-08-23 | 分类于 LeetCode | 阅读次数
字数统计 294 | 阅读时长 1

Sort a linked list using insertion sort.

题意:

  使用插入排序对单链表进行排序。

阅读全文 »

145. Binary Tree Postorder Traversal

发表于 2017-08-23 | 分类于 LeetCode | 阅读次数
字数统计 303 | 阅读时长 1

Given a binary tree, return the postorder traversal of its nodes’ values.

1
2
3
4
5
6
7
8
9
For example :
Given binary tree{ 1,#,2,3 },

1
\
2
/
3
return[3, 2, 1].
阅读全文 »

144. Binary Tree Preorder Traversal

发表于 2017-08-23 | 分类于 LeetCode | 阅读次数
字数统计 322 | 阅读时长 2

Given a binary tree, return the preorder traversal of its nodes’ values.

1
2
3
4
5
6
7
8
9
For example :
Given binary tree{ 1,#,2,3 },

1
\
2
/
3
return[1, 2, 3].
阅读全文 »

143. Reorder List

发表于 2017-08-23 | 分类于 LeetCode | 阅读次数
字数统计 479 | 阅读时长 2

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{ 1,4,2,3 }.

阅读全文 »

142. Linked List Cycle II

发表于 2017-08-23 | 分类于 LeetCode | 阅读次数
字数统计 595 | 阅读时长 3

Given a linked list, return the node where the cycle begins.If there is no cycle, return null.

Note: Do not modify the linked list.

阅读全文 »

141. Linked List Cycle

发表于 2017-08-22 | 分类于 LeetCode | 阅读次数
字数统计 202 | 阅读时长 1

141. 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 ?

阅读全文 »

138. Copy List with Random Pointer

发表于 2017-08-22 | 分类于 LeetCode | 阅读次数
字数统计 639 | 阅读时长 3

138. 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.

阅读全文 »
1…456…17
CodePikachu

CodePikachu

技术随笔

168 日志
5 分类
7 标签
RSS
GitHub Twitter 微博 知乎
0%
© 2015 - 2020 CodePikachu
博客全站共123.3k字
本站访客数:
由 Hexo 强力驱动
主题 - NexT.Pisces