2014年11月9日

Palindrome Number

摘要: Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space. 1 public class Solution { 2 public boolean isPalindrom... 阅读全文

posted @ 2014-11-09 22:57 luckygxf 阅读(145) 评论(0) 推荐(0) 编辑

String to Integer (atoi)

摘要: String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, plea... 阅读全文

posted @ 2014-11-09 22:41 luckygxf 阅读(254) 评论(0) 推荐(0) 编辑

Reverse Integer

摘要: Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 1 public class Solution { 2 public int reve... 阅读全文

posted @ 2014-11-09 21:23 luckygxf 阅读(141) 评论(0) 推荐(0) 编辑

Count and Say

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

posted @ 2014-11-09 21:12 luckygxf 阅读(192) 评论(0) 推荐(0) 编辑

Merge Two Sorted Lists

摘要: 归并两个有序序列为一个有序序列Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the n... 阅读全文

posted @ 2014-11-09 16:09 luckygxf 阅读(128) 评论(0) 推荐(0) 编辑

Binary Tree Level Order Traversal

摘要: Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).Fo... 阅读全文

posted @ 2014-11-09 15:23 luckygxf 阅读(159) 评论(0) 推荐(0) 编辑

Binary Tree Level Order Traversal II

摘要: 这道题A的略烦Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right... 阅读全文

posted @ 2014-11-09 14:19 luckygxf 阅读(161) 评论(0) 推荐(0) 编辑

图和图的遍历算法

摘要: 图和图的遍历算法1.存储结构(邻接链表)1.1每个顶点用VexNode类表示,每条边用ArcNode表示1.2所有顶点用数组VexNode adjlist[]表示,所有邻接顶点用链表表示2.遍历算法2.1深度优先遍历DFS用递归实现,从V0开始,访问V0即邻接顶点V1,访问V1及其邻接顶点...2.... 阅读全文

posted @ 2014-11-09 12:47 luckygxf 阅读(618) 评论(0) 推荐(0) 编辑

导航