- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 Leetcode NO.103 Binary Tree Zigzag Level Order Traversal
本题题目要求如下:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:
2015-03-21 10:09:41 366
原创 Leetcode NO.133 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 are labeled uniquely.We use # as a sep
2015-03-21 09:44:46 355
原创 Leetcode NO.186 Reverse Words in a String II
题目要求如下:Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters.The input string does not contain leading or trailing spaces and the wo
2015-03-19 06:42:54 492
原创 Leetcode NO.179 Largest Number
本题题目要求如下:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The r
2015-03-18 06:50:51 403
原创 Leetcode NO.31 Next Permutation
本题题目要求如下:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the
2015-03-17 08:42:38 429
原创 Leetcode NO.95 Unique Binary Search Trees II
本题题目要求如下:Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below.
2015-03-17 05:59:26 327
原创 Leetcode NO.190 Reverse Bits
题目要求如下:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary
2015-03-13 23:43:27 365
原创 Leetcode NO.134 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 costs cost[i] of gas to travel fro
2015-03-13 13:10:54 380
原创 Leetcode NO.122 Best Time to Buy and Sell Stock II
本题题目要求如下:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you l
2015-03-13 10:26:09 346
原创 Leetcode NO.121 Best Time to Buy and Sell Stock
本题题目要求如下:Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of
2015-03-13 09:02:51 383
原创 Leetcode NO.191 Number of 1 Bits
本题题目要求如下:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit integer ’11' has binary representat
2015-03-13 07:39:28 418
原创 Leetcode NO.38 Count and Say
本题题目要求如下:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21
2015-03-05 10:12:37 342
原创 Leetcode NO.59 Spiral Matrix II
本题题目要求如下:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ],
2015-03-04 03:50:04 323
原创 Leetcode NO.54 Spiral Matrix
本题题目要求如下:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7
2015-03-04 02:34:34 358
原创 Epic 面试专题
由于3月5号要进行Epic公司的Online Assessment,准备刷些面经做准备,毕竟这是我的第一次比较重要的面试。。这是我准备Epic技术面试的小专栏。。。希望面试的时候能做够30题+吧,这样做OA的时候会轻松一点。目前完成:29题/*************************************************我是分割线*************
2015-03-03 13:39:15 5376 4
原创 Leetcode NO.101 Symmetric Tree
本题题目要求如下:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3
2015-03-03 11:53:26 449
原创 Stanford - Algorithms: Design and Analysis, Part 1 - Week 5 Assignment: Dijkstra
本次作业要求如下:In this programming problem you'll code up Dijkstra's shortest-path algorithm. Download the text file here. (Right click and save link as). The file contains an adjacency list represe
2015-03-03 09:18:43 1432
原创 Stanford - Algorithms: Design and Analysis, Part 1 - Week 4 Assignment: strongly connected component
本次作业要求如下:Question 1Download the text file here. Zipped version here. (Right click and save link as)The file contains the edges of a directed graph. Vertices are labeled as positive int
2015-03-03 07:05:28 2693
原创 Leetcode NO.160 Intersection of Two Linked Lists
本题题目要求如下:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘
2015-03-01 10:52:26 486
Algorithm in C++, Part 1 - Part 4
2014-02-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人