摘要: 题目: 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 fol 阅读全文
posted @ 2016-02-28 22:46 wxquare 阅读(178) 评论(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: [ 阅读全文
posted @ 2016-02-28 22:43 wxquare 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 ≤ B 阅读全文
posted @ 2016-02-28 22:43 wxquare 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 题目: Description: Count the number of prime numbers less than a non-negative number, n. cpp: class Solution { public: int countPrimes(int n) { bool isP 阅读全文
posted @ 2016-02-28 14:20 wxquare 阅读(126) 评论(0) 推荐(0) 编辑