2015年6月14日
摘要: Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an... 阅读全文
posted @ 2015-06-14 23:14 gone~with~wind 阅读(94) 评论(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 le... 阅读全文
posted @ 2015-06-14 23:06 gone~with~wind 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen... 阅读全文
posted @ 2015-06-14 21:43 gone~with~wind 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
posted @ 2015-06-14 15:56 gone~with~wind 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.构建字典树class TrieNode {... 阅读全文
posted @ 2015-06-14 13:38 gone~with~wind 阅读(197) 评论(0) 推荐(0) 编辑