摘要:
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2017-12-04 16:06
jasminemzy
阅读(152)
评论(0)
推荐(0)
摘要:
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
posted @ 2017-12-04 14:54
jasminemzy
阅读(162)
评论(0)
推荐(0)
摘要:
Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not conta 阅读全文
posted @ 2017-12-04 14:17
jasminemzy
阅读(209)
评论(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 阅读全文
posted @ 2017-12-04 13:29
jasminemzy
阅读(179)
评论(0)
推荐(0)
摘要:
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: You s 阅读全文
posted @ 2017-12-04 10:31
jasminemzy
阅读(99)
评论(0)
推荐(0)
摘要:
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2017-12-04 08:48
jasminemzy
阅读(194)
评论(0)
推荐(0)
摘要:
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2017-12-04 08:24
jasminemzy
阅读(113)
评论(0)
推荐(0)
摘要:
Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If 阅读全文
posted @ 2017-12-04 06:47
jasminemzy
阅读(179)
评论(0)
推荐(0)

浙公网安备 33010602011771号