代码改变世界

随笔分类 -  数据结构与算法

Kth Largest Element in an Array

2017-03-02 13:37 by 老左的博客, 161 阅读, 收藏, 编辑
摘要: 题目描述: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Fo 阅读全文

字典树用于单词联想

2017-02-27 00:25 by 老左的博客, 470 阅读, 收藏, 编辑
摘要: 最近要做一个单词联想的功能,经过调研选择使用字典树,节省空间,查找快。 贴上代码 >> 1 >> ['abc', 'alter', 'hello', 'salt'] >> ['abc', 'alter'] >> abc >> alter >> hello >> salt 代码参考 https://g 阅读全文