摘要: 题目: 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 neare 阅读全文
posted @ 2016-04-25 15:48 CodingGirl121 阅读(162) 评论(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 tr 阅读全文
posted @ 2016-04-25 15:40 CodingGirl121 阅读(198) 评论(0) 推荐(0)
摘要: 题目:Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 题目解答: 这个题目是要求出给定的整数n的 阅读全文
posted @ 2016-04-25 15:24 CodingGirl121 阅读(117) 评论(0) 推荐(0)
摘要: 题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: But the 阅读全文
posted @ 2016-04-24 00:46 CodingGirl121 阅读(143) 评论(0) 推荐(0)
摘要: 题目:Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in fr 阅读全文
posted @ 2016-04-23 22:30 CodingGirl121 阅读(114) 评论(0) 推荐(0)
摘要: 题目: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the 阅读全文
posted @ 2016-04-23 21:32 CodingGirl121 阅读(106) 评论(0) 推荐(0)
摘要: 题目:Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Yo 阅读全文
posted @ 2016-04-23 20:42 CodingGirl121 阅读(118) 评论(0) 推荐(0)
摘要: 题目: Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = "hello", return "holle". Example 2: Gi 阅读全文
posted @ 2016-04-23 20:00 CodingGirl121 阅读(317) 评论(0) 推荐(0)
摘要: 题目:Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transact 阅读全文
posted @ 2016-04-23 17:27 CodingGirl121 阅读(143) 评论(0) 推荐(0)
摘要: 题目: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive in 阅读全文
posted @ 2016-04-23 17:04 CodingGirl121 阅读(149) 评论(0) 推荐(0)