上一页 1 ··· 7 8 9 10 11 12 下一页
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. Note: Re 阅读全文
posted @ 2016-09-11 06:17 咖啡中不塌缩的方糖 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" path = "/a/./b/. 阅读全文
posted @ 2016-09-11 05:29 咖啡中不塌缩的方糖 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2016-09-11 04:36 咖啡中不塌缩的方糖 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-09-09 11:55 咖啡中不塌缩的方糖 阅读(104) 评论(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 @ 2016-09-09 10:25 咖啡中不塌缩的方糖 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 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. Recursiv 阅读全文
posted @ 2016-09-08 23:37 咖啡中不塌缩的方糖 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? if use space O(1), we need to use 阅读全文
posted @ 2016-09-08 22:38 咖啡中不塌缩的方糖 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
posted @ 2016-09-08 12:25 咖啡中不塌缩的方糖 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2016-09-08 12:00 咖啡中不塌缩的方糖 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 典型的2 pointer 问题,一个走的快,一个走到慢,如果是cycle就一定会 阅读全文
posted @ 2016-09-08 11:15 咖啡中不塌缩的方糖 阅读(99) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 下一页