CODE 147: Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or anoth...

2013-11-28 22:23:01

阅读数:493

评论数:0

CODE 146: Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. public int maxPoints(Point[] points) { // I...

2013-11-28 22:16:20

阅读数:553

评论数:0

CODE 144: Insertion Sort List

Sort a linked list using insertion sort. public ListNode insertionSortList(ListNode head) { // IMPORTANT: Please reset any member data you declar...

2013-11-27 19:56:56

阅读数:345

评论数:0

CODE 145: Sort List

Sort a linked list in O(n log n) time using constant space complexity. public ListNode sortList(ListNode head) { // IMPORTANT: Please reset any...

2013-11-26 22:35:50

阅读数:488

评论数:0

PS制作图片圆角教程

点击打开链接 最近新做了一个模板的LOGO,为了让其更具美观和平滑型因此需要把图片角部修改为圆角,PS新手不防学习一下。 1.打开PhotoShop,并找开要处理的图片; 2.使用工具栏中的"矩形"工具,并对其如下设置: 在写有"注意&...

2013-11-26 22:34:42

阅读数:481

评论数:0

CODE 143:LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get t...

2013-11-26 21:38:45

阅读数:309

评论数:0

CODE 142: Binary Tree Postorder Traversal

Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / ...

2013-11-25 22:37:26

阅读数:376

评论数:0

CODE 141: Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / ...

2013-11-25 22:15:33

阅读数:381

评论数:0

CODE 140: Reorder List

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

2013-11-25 20:37:24

阅读数:333

评论数:0

CODE 139: Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra spa...

2013-11-24 22:01:49

阅读数:415

评论数:0

CODE 138: 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? public boolean hasCycle(List...

2013-11-24 16:07:29

阅读数:398

评论数:0

CODE 137: Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all su...

2013-11-24 15:50:21

阅读数:508

评论数:0

CODE 136: Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. ...

2013-11-23 21:22:58

阅读数:672

评论数:0

CODE 135: 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 ...

2013-11-23 18:11:06

阅读数:512

评论数:0

CODE 134: Single Number II

Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtim...

2013-11-23 17:49:40

阅读数:408

评论数:0

CODE 133: Single Number

Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime c...

2013-11-23 16:52:37

阅读数:438

评论数:0

CODE 132: Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin...

2013-11-23 16:49:20

阅读数:532

评论数:0

CODE 131: Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it ...

2013-11-22 22:14:51

阅读数:459

评论数:0

CODE 6: Word Ladder II

Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be...

2013-11-19 23:01:13

阅读数:658

评论数:0

CODE 130: Clone Graph

Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes ar...

2013-11-18 23:51:32

阅读数:599

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭