摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two... 阅读全文
posted @ 2015-11-09 11:10 fenshen371 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl... 阅读全文
posted @ 2015-11-09 10:43 fenshen371 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regu... 阅读全文
posted @ 2015-11-09 08:04 fenshen371 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.思路:应该就是字典树。 1 class T... 阅读全文
posted @ 2015-11-09 07:39 fenshen371 阅读(133) 评论(0) 推荐(0) 编辑