随笔分类 -  introduce to algorithm

algorithm
摘要:冒泡排序 Bubble Sort O(N^2) 选择排序 select sort 是一种简单直观的排序算法。它的工作原理如下。首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的末尾。以此类推,直到所有元素均排序完毕。 阅读全文
posted @ 2016-11-12 01:53 微微程序媛 阅读(300) 评论(0) 推荐(0)
摘要:DFS : depth first search BFS: breadth first search DFS : 46. Permutations Given a collection of distinct numbers, return all possible permutations. Fo 阅读全文
posted @ 2016-10-04 03:55 微微程序媛 阅读(164) 评论(0) 推荐(0)
摘要:Binary Search 模版 四种结构 阅读全文
posted @ 2016-10-02 05:37 微微程序媛 阅读(129) 评论(0) 推荐(0)
摘要:Description: Count the number of prime numbers less than a non-negative number, n. 阅读全文
posted @ 2016-08-29 09:17 微微程序媛 阅读(122) 评论(0) 推荐(0)
摘要:hashmap map key and value for highly efficient lookup.hashmap search used binary tree O(log2)main methodsint size();hashmap.put(key,value);Value get(k... 阅读全文
posted @ 2015-06-18 03:14 微微程序媛 阅读(373) 评论(1) 推荐(0)
摘要:Rotate ListGiven a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3-... 阅读全文
posted @ 2015-06-12 08:36 微微程序媛 阅读(176) 评论(0) 推荐(0)
摘要:Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文
posted @ 2015-06-08 09:04 微微程序媛 阅读(200) 评论(0) 推荐(0)
摘要:Linklist定义:node includes pointer(next) and value区别(与Array):Array has indice,which is in sequence,LinkList has pointer to next.single list and double l... 阅读全文
posted @ 2015-06-06 06:24 微微程序媛 阅读(176) 评论(0) 推荐(0)