随笔分类 -  Level 3

上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要:Design a data structure that supports the following two operations: addWord(word) andsearch(word) search(word) can search a literal word or a regular 阅读全文
posted @ 2016-07-13 05:58 北叶青藤 阅读(254) 评论(0) 推荐(0)
摘要:Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Notice Please complete the problem in-place. 阅读全文
posted @ 2016-07-12 23:56 北叶青藤 阅读(281) 评论(0) 推荐(0)
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded messag 阅读全文
posted @ 2016-07-12 02:45 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain 阅读全文
posted @ 2016-07-12 00:26 北叶青藤 阅读(231) 评论(0) 推荐(0)
摘要:Coins in a Line I There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The 阅读全文
posted @ 2016-07-10 04:06 北叶青藤 阅读(210) 评论(0) 推荐(0)
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Given a st 阅读全文
posted @ 2016-07-09 09:23 北叶青藤 阅读(201) 评论(0) 推荐(0)
摘要:There is a fence with n posts, each post can be painted with one of the k colors.You have to paint all the posts such that no more than two adjacent f 阅读全文
posted @ 2016-07-09 06:41 北叶青藤 阅读(295) 评论(0) 推荐(0)
摘要:For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify function wit 阅读全文
posted @ 2016-07-09 02:19 北叶青藤 阅读(176) 评论(0) 推荐(0)
摘要:Given n, how many structurally unique BSTs (binary search trees) that store values 1...n? Given n, how many structurally unique BSTs (binary search tr 阅读全文
posted @ 2016-07-08 23:11 北叶青藤 阅读(183) 评论(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-07-08 10:29 北叶青藤 阅读(169) 评论(0) 推荐(0)
摘要:Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. Example Given the below binary tree: 1 / \ 2 3 ret 阅读全文
posted @ 2016-07-08 10:19 北叶青藤 阅读(230) 评论(0) 推荐(0)
摘要:Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes. The lowest common ancestor is the node with larg 阅读全文
posted @ 2016-07-08 02:55 北叶青藤 阅读(238) 评论(0) 推荐(0)
摘要:Design an iterator over a binary search tree with the following rules: Elements are visited in ascending order (i.e. an in-order traversal) next() and 阅读全文
posted @ 2016-07-08 02:39 北叶青藤 阅读(171) 评论(0) 推荐(0)
摘要:Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Clarification What's the de 阅读全文
posted @ 2016-07-08 00:58 北叶青藤 阅读(245) 评论(0) 推荐(0)
摘要:Search a 2D Matrix II Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it. This matrix has the foll 阅读全文
posted @ 2016-07-06 10:43 北叶青藤 阅读(211) 评论(0) 推荐(0)
摘要:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example Given lists: [ 2->4->null, null, -1->null ] 阅读全文
posted @ 2016-07-06 07:22 北叶青藤 阅读(173) 评论(0) 推荐(0)
摘要:Ugly Number Write a program to check whether a given number is an ugly number`. Ugly numbers are positive numbers whose prime factors only include 2,  阅读全文
posted @ 2016-07-06 04:12 北叶青藤 阅读(333) 评论(0) 推荐(0)
摘要:Write an algorithm which computes the number of trailing zeros in n factorial. Have you met this question in a real interview? Yes Write an algorithm 阅读全文
posted @ 2016-07-06 02:16 北叶青藤 阅读(180) 评论(0) 推荐(0)
摘要:For an array A, if i < j, and A [i] > A [j], called (A [i], A [j]) is a reverse pair.return total of reverse pairs in A. For an array A, if i < j, and 阅读全文
posted @ 2016-07-06 02:01 北叶青藤 阅读(220) 评论(0) 推荐(0)
摘要:Swap Nodes | Given a linked list, swap every two adjacent nodes and return its head. Example Given 1->2->3->4, you should return the list as 2->1->4-> 阅读全文
posted @ 2016-07-05 12:24 北叶青藤 阅读(191) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 下一页