摘要: 题目: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)