2015年6月16日

Count Complete Tree Nodes

摘要: Count Complete Tree Nodes问题:Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete bin... 阅读全文

posted @ 2015-06-16 17:04 zhouzhou0615 阅读(193) 评论(0) 推荐(0) 编辑

Implement Stack using Queues

摘要: Implement Stack using Queues问题:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the el... 阅读全文

posted @ 2015-06-16 15:31 zhouzhou0615 阅读(245) 评论(0) 推荐(0) 编辑

Rectangle Area

摘要: Rectangle Area问题:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right... 阅读全文

posted @ 2015-06-16 10:22 zhouzhou0615 阅读(264) 评论(0) 推荐(0) 编辑

Invert Binary Tree

摘要: Invert Binary Tree问题:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1思路: 简单的递归我的代码:pub... 阅读全文

posted @ 2015-06-16 09:46 zhouzhou0615 阅读(125) 评论(0) 推荐(0) 编辑

导航