上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2016-10-11 16:00 Machelsky 阅读(185) 评论(0) 推荐(0)
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2016-10-11 15:50 Machelsky 阅读(98) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2016-10-11 15:22 Machelsky 阅读(140) 评论(0) 推荐(0)
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2016-10-11 14:53 Machelsky 阅读(115) 评论(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-10-11 13:18 Machelsky 阅读(83) 评论(0) 推荐(0)
摘要: 66. Plus One: 只需考虑数字是不是9即可,不是9,直接加1输出,是9,就继续检查更新。如果结束循环还不输出,就是全9情况,建新array输出第一位为1. 阅读全文
posted @ 2016-10-11 12:03 Machelsky 阅读(71) 评论(0) 推荐(0)
摘要: 1. HashMap 和 HashTable 转:http://www.cnblogs.com/devinzhang/archive/2012/01/13/2321481.html 阅读全文
posted @ 2016-10-11 08:24 Machelsky 阅读(93) 评论(0) 推荐(0)
摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. 122/145 思路:遍历整个matrix,找到element是0的时候,记录对应的row和column。有两个 阅读全文
posted @ 2016-10-10 13:04 Machelsky 阅读(91) 评论(0) 推荐(0)
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文
posted @ 2016-10-10 12:35 Machelsky 阅读(120) 评论(0) 推荐(0)
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2016-10-10 07:35 Machelsky 阅读(141) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 15 下一页