08 2015 档案

摘要:原题链接在这里:https://leetcode.com/problems/linked-list-cycle/ 题目: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it withou 阅读全文
posted @ 2015-08-29 22:12 Dylan_Java_NYC 阅读(182) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/swap-nodes-in-pairs/ 题目: Given a linked list, swap every two adjacent nodes and return its head. You must solve 阅读全文
posted @ 2015-08-29 21:51 Dylan_Java_NYC 阅读(208) 评论(0) 推荐(0) 编辑
摘要:原题链接:https://leetcode.com/problems/add-two-numbers/ 题目: You are given two linked lists representing two non-negative numbers. The digits are stored in 阅读全文
posted @ 2015-08-29 05:39 Dylan_Java_NYC 阅读(261) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/intersection-of-two-linked-lists/ 题目: Write a program to find the node at which the intersection of two singly l 阅读全文
posted @ 2015-08-29 04:07 Dylan_Java_NYC 阅读(241) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/palindrome-linked-list/ 题目: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do 阅读全文
posted @ 2015-08-29 03:19 Dylan_Java_NYC 阅读(231) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ 题目: Given a linked list, remove the nth node from the end of list and return i 阅读全文
posted @ 2015-08-29 01:00 Dylan_Java_NYC 阅读(206) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reverse-nodes-in-k-group/ 题目: Given a linked list, reverse the nodes of a linked list k at a time and return its 阅读全文
posted @ 2015-08-27 02:53 Dylan_Java_NYC 阅读(230) 评论(0) 推荐(0) 编辑
摘要:原题链接:https://leetcode.com/problems/remove-linked-list-elements/ 题目: Remove all elements from a linked list of integers that have value val. ExampleGiv 阅读全文
posted @ 2015-08-23 00:14 Dylan_Java_NYC 阅读(178) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reverse-linked-list-ii/ 题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For exam 阅读全文
posted @ 2015-08-22 05:20 Dylan_Java_NYC 阅读(338) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reverse-linked-list/ 题目: Reverse a singly linked list. 题解: Iteration 方法: 生成tail = head, cur = tail, while loop 的 阅读全文
posted @ 2015-08-22 04:15 Dylan_Java_NYC 阅读(391) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/evaluate-reverse-polish-notation/ 题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation. 阅读全文
posted @ 2015-08-22 01:10 Dylan_Java_NYC 阅读(173) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/basic-calculator-ii/ 题目: Implement a basic calculator to evaluate a simple expression string. The expression str 阅读全文
posted @ 2015-08-21 12:21 Dylan_Java_NYC 阅读(406) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/basic-calculator/ 题目: Implement a basic calculator to evaluate a simple expression string. The expression string 阅读全文
posted @ 2015-08-21 09:42 Dylan_Java_NYC 阅读(329) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ 题目: Given a binary tree, return the zigzag level order traversal of it 阅读全文
posted @ 2015-08-21 07:48 Dylan_Java_NYC 阅读(263) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-level-order-traversal/ 题目: Given a binary tree, return the level order traversal of its nodes' value 阅读全文
posted @ 2015-08-21 06:54 Dylan_Java_NYC 阅读(372) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ 题目: Given inorder and postorder traversal of a tree, 阅读全文
posted @ 2015-08-21 03:03 Dylan_Java_NYC 阅读(219) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 题目: Given preorder and inorder traversal of a tree, c 阅读全文
posted @ 2015-08-21 02:33 Dylan_Java_NYC 阅读(293) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/majority-element/ 题目: Given an array of size n, find the majority element. The majority element is the element t 阅读全文
posted @ 2015-08-20 10:32 Dylan_Java_NYC 阅读(283) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-postorder-traversal/ 题目: Given a binary tree, return the postorder traversal of its nodes' values. F 阅读全文
posted @ 2015-08-20 08:01 Dylan_Java_NYC 阅读(332) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-inorder-traversal/# 题目: Given a binary tree, return the inorder traversal of its nodes' values. For 阅读全文
posted @ 2015-08-20 02:48 Dylan_Java_NYC 阅读(323) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-preorder-traversal/ 题目: Given a binary tree, return the preorder traversal of its nodes' values. For 阅读全文
posted @ 2015-08-19 09:15 Dylan_Java_NYC 阅读(427) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/min-stack/ 题目: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time 阅读全文
posted @ 2015-08-19 05:07 Dylan_Java_NYC 阅读(287) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/valid-parentheses/ 题目: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine 阅读全文
posted @ 2015-08-18 12:02 Dylan_Java_NYC 阅读(162) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/implement-queue-using-stacks/ 题目: Implement the following operations of a queue using stacks. push(x) -- Push el 阅读全文
posted @ 2015-08-18 11:35 Dylan_Java_NYC 阅读(213) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/implement-stack-using-queues/ 题目: Implement the following operations of a stack using queues. push(x) -- Push el 阅读全文
posted @ 2015-08-18 10:57 Dylan_Java_NYC 阅读(258) 评论(0) 推荐(0) 编辑
摘要:这是一道面试亚马逊时的题目,要求Time O(n). 我刚开始想的是算出所有的数的总product,再去除以对应位置的元素,但这种做法的问题是若该位置为0,就会报错。到网上搜了下,才知道,原来有这种做法。e.g. arr = {0,1,2,3},生成两个array: upArr = {1,arr[0... 阅读全文
posted @ 2015-08-18 04:09 Dylan_Java_NYC 阅读(165) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/multiply-strings/ 题目: Given two non-negative integers num1 and num2 represented as strings, return the product o 阅读全文
posted @ 2015-08-18 03:32 Dylan_Java_NYC 阅读(283) 评论(0) 推荐(0) 编辑
摘要:当 arr 是一个array时,写Java开始的corner case常常会写类似下面的语句:if(arr == null || arr.length == 0){ return 0;}其实这是两个条件, arr==null 和 arr.length==0 是不同的:arr.length ==... 阅读全文
posted @ 2015-08-17 01:33 Dylan_Java_NYC 阅读(464) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/add-digits/ 题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one di 阅读全文
posted @ 2015-08-17 01:13 Dylan_Java_NYC 阅读(166) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/divide-two-integers/ 题目: Divide two integers without using multiplication, division and mod operator. If it is o 阅读全文
posted @ 2015-08-17 00:22 Dylan_Java_NYC 阅读(367) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/add-binary/ 题目: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"R 阅读全文
posted @ 2015-08-15 09:36 Dylan_Java_NYC 阅读(221) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/power-of-two/ 题目: Given an integer, write a function to determine if it is a power of two. 题解: bit manipulation, 阅读全文
posted @ 2015-08-15 08:39 Dylan_Java_NYC 阅读(359) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/rectangle-area/ 题目: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is d 阅读全文
posted @ 2015-08-15 07:56 Dylan_Java_NYC 阅读(188) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/factorial-trailing-zeroes/ 题目: Given an integer n, return the number of trailing zeroes in n!. Example 1: Exampl 阅读全文
posted @ 2015-08-14 12:24 Dylan_Java_NYC 阅读(181) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/integer-to-roman/ 题目: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For exa 阅读全文
posted @ 2015-08-14 11:39 Dylan_Java_NYC 阅读(266) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/roman-to-integer/ 题目: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For exa 阅读全文
posted @ 2015-08-14 04:02 Dylan_Java_NYC 阅读(218) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/excel-sheet-column-number/ 题目: Given a column title as appear in an Excel sheet, return its corresponding column 阅读全文
posted @ 2015-08-14 00:37 Dylan_Java_NYC 阅读(185) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/excel-sheet-column-title/ 题目: Given a positive integer, return its corresponding column title as appear in an E 阅读全文
posted @ 2015-08-14 00:20 Dylan_Java_NYC 阅读(320) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/minimum-window-substring/ 题目: Given a string S and a string T, find the minimum window in S which will contain 阅读全文
posted @ 2015-08-13 04:51 Dylan_Java_NYC 阅读(702) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/substring-with-concatenation-of-all-words/description/ 题目: ou are given a string s and an array of strings word 阅读全文
posted @ 2015-08-12 10:14 Dylan_Java_NYC 阅读(266) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/longest-substring-without-repeating-characters/ 题目: Given a string, find the length of the longest substring wit 阅读全文
posted @ 2015-08-08 10:30 Dylan_Java_NYC 阅读(422) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/single-number/ 题目: Given an array of integers, every element appears twice except for one. Find that single one. 阅读全文
posted @ 2015-08-06 08:58 Dylan_Java_NYC 阅读(249) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/single-number-ii/ 题目: Given a non-empty array of integers, every element appears three times except for one, whi 阅读全文
posted @ 2015-08-06 08:31 Dylan_Java_NYC 阅读(208) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/3sum-closest/ 题目: Given an array S of n integers, find three integers in S such that the sum is closest to a giv 阅读全文
posted @ 2015-08-06 02:44 Dylan_Java_NYC 阅读(216) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/4sum/ 题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = targe 阅读全文
posted @ 2015-08-05 05:41 Dylan_Java_NYC 阅读(195) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/3sum/ 题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all uniq 阅读全文
posted @ 2015-08-05 04:42 Dylan_Java_NYC 阅读(338) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/fraction-to-recurring-decimal/ 题目: Given two integers representing the numerator and denominator of a fraction, 阅读全文
posted @ 2015-08-04 04:51 Dylan_Java_NYC 阅读(385) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/anagrams/ Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", " 阅读全文
posted @ 2015-08-03 12:09 Dylan_Java_NYC 阅读(304) 评论(0) 推荐(0) 编辑
摘要:Basically, they are just two different implementations of List interface.LinkedList is implemented with a double-linked list; ArrayList is implemented... 阅读全文
posted @ 2015-08-03 11:32 Dylan_Java_NYC 阅读(301) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/valid-anagram/ 题目: Given two strings s and t, write a function to determine if t is an anagram of s. For example 阅读全文
posted @ 2015-08-03 10:48 Dylan_Java_NYC 阅读(195) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/count-primes/ 题目: Given an integer n, return the number of prime numbers that are strictly less than n. Example 阅读全文
posted @ 2015-08-03 02:57 Dylan_Java_NYC 阅读(209) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示