
查找
文章平均质量分 83
macans
止步就是退步
展开
-
insertion-sort-list
Sort a linked list using insertion sort. /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {原创 2016-09-23 13:52:33 · 335 阅读 · 0 评论 -
LeetCode----word-ladder
题目描述 Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a timeEach int原创 2016-10-18 13:12:15 · 472 阅读 · 0 评论 -
字符串的经典hash算法
1 概述 链表查找的时间效率为O(N),二分法为log2N,B+ Tree为log2N,但Hash链表查找的时间效率为O(1)。 设计高效算法往往需要使用Hash链表,常数级的查找速度是任何别的算法无法比拟的,Hash链表的构造和冲突的不同实现方法对效率当然有一定的影响,然而Hash函数是Hash链表最核心的部分,本文尝试分析一些经典软件中使用到的字符串Hash函数在执行效率、离散性、空转载 2017-04-17 21:17:58 · 856 阅读 · 0 评论