上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3, You should return the followi 阅读全文
posted @ 2016-09-23 08:50 Machelsky 阅读(120) 评论(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 @ 2016-09-23 08:26 Machelsky 阅读(111) 评论(0) 推荐(0)
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2016-09-23 06:39 Machelsky 阅读(102) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2016-09-23 06:04 Machelsky 阅读(109) 评论(0) 推荐(0)
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2016-09-23 05:52 Machelsky 阅读(113) 评论(0) 推荐(0)
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2016-09-23 05:19 Machelsky 阅读(167) 评论(0) 推荐(0)
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2016-09-23 05:04 Machelsky 阅读(108) 评论(0) 推荐(0)
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2016-09-22 09:18 Machelsky 阅读(140) 评论(0) 推荐(0)
摘要: There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai 阅读全文
posted @ 2016-09-22 08:40 Machelsky 阅读(536) 评论(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 @ 2016-09-22 08:14 Machelsky 阅读(136) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页