上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 34 下一页

2015年3月19日

Largest Number

摘要: 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 l... 阅读全文

posted @ 2015-03-19 14:12 zhouzhou0615 阅读(213) 评论(0) 推荐(0) 编辑

2015年3月17日

Binary Tree Postorder Traversal

摘要: Binary Tree Postorder Traversal问题:Given a binary tree, return thepostordertraversal of its nodes' values.思路: 栈方法我的代码:public class Solution { publi... 阅读全文

posted @ 2015-03-17 19:26 zhouzhou0615 阅读(158) 评论(0) 推荐(0) 编辑

Recover Binary Search Tree

摘要: Recover Binary Search Tree问题:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A ... 阅读全文

posted @ 2015-03-17 15:28 zhouzhou0615 阅读(143) 评论(0) 推荐(0) 编辑

2015年3月16日

Count and Say

摘要: Count and Say问题:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11i... 阅读全文

posted @ 2015-03-16 21:26 zhouzhou0615 阅读(124) 评论(0) 推荐(0) 编辑

Add Binary

摘要: Add Binary问题:Given two binary strings, return their sum (also a binary string).思路: 归并排序收尾工作我的代码:public class Solution { public String addBinary(St... 阅读全文

posted @ 2015-03-16 16:30 zhouzhou0615 阅读(113) 评论(0) 推荐(0) 编辑

Clone Graph

摘要: Clone Graph问题:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.思路: dfs 或者 bfs我的代码1:(dfs)public class Solut... 阅读全文

posted @ 2015-03-16 16:04 zhouzhou0615 阅读(123) 评论(0) 推荐(0) 编辑

Longest Substring Without Repeating Characters

摘要: Longest Substring Without Repeating Characters问题:Given a string, find the length of the longest substring without repeating characters. For example, t... 阅读全文

posted @ 2015-03-16 09:00 zhouzhou0615 阅读(196) 评论(0) 推荐(0) 编辑

2015年3月15日

Merge Intervals

摘要: Merge Intervals问题:Given a collection of intervals, merge all overlapping intervals.思路: 不排序 直接上根据交集的特性 排序后再判断 简单的数学推导我的代码1:public class Solution { ... 阅读全文

posted @ 2015-03-15 20:40 zhouzhou0615 阅读(147) 评论(0) 推荐(0) 编辑

Unique Binary Search Trees II

摘要: Unique Binary Search Trees II问题:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.思路: dfs或者动态规划我的代码:public c... 阅读全文

posted @ 2015-03-15 19:37 zhouzhou0615 阅读(209) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Longest Common Prefix问题:Write a function to find the longest common prefix string amongst an array of strings.思路: 简单的string运算我的代码:public class Soluti... 阅读全文

posted @ 2015-03-15 17:04 zhouzhou0615 阅读(118) 评论(0) 推荐(0) 编辑

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 34 下一页

导航