public class HeapSort { public static void main(String[] args) { int[] array = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,…
选择排序
/** * <p>在要排序的一组数中,选出最小(或者最大)的一个数与第1个位置的数交换;</p> * <p>然后在剩下的数当中再找最小(或者最大)的与第2个位置的数交换。</p&…
hashmap、concurrenthashmap原理解析
hashmap原理解析 concurrenthashmap原理解析 concurrenthashmap原理解析二 hash方法
归并排序
public class RecursiveMergeSort { public static void main(String[] args) { int[] data = new int[] { 5, 3, 6, 2…
动态规划求编辑距离
参考:http://topic.csdn.net/u/20110607/07/63dec342-b2ec-4f5c-82a8-044531d78392.html  …
表达式前后缀表达形式 [zz]
装载:http://blog.csdn.net/whatforever/article/details/6738538 35,15,+,80,70,-,*,20,/ &nbs…
大数乘法
转载:http://blog.csdn.net/taesimple/article/details/7554086 这里的大数是指:超过计算机变量(包括long long)表示范围的数 因此我们考虑用字符串保存…
求一个字符串中连续出现次数最多的字串
#include<iostream> #include<vector> #include<string> using namespace std; pair<int, strin…
删除字符串中多余的空格(只保留一个空格)
#include<iostream> #include<stdio.h> #include<stdlib.h> using namespace std; void f(char* s1…
对内存重叠的深入认识
装载:http://blog.csdn.net/feitianxuxue/article/details/7195158 内存重叠:拷贝的目的地址在源地址范围内。所谓内存重叠就是拷贝的目的地址和源地址有重叠。 在函数st…
求两个字符串的最长的连续公共子串
转载地址:http://blog.csdn.net/shandianling/article/details/7913818 这与求两个字符串的公共子序列要区分开,见http://blog.csdn.net/shandi…
字符串全排序问题
#include<iostream> using namespace std; void Swap(char &a, char &b) { char temp; temp = a; a = b…