
数据结构和算法分析
qscool1987
|厚积薄发|
|贵在坚持|
展开
-
一道简单题目的数据结构算法分析
问题描述:一个保存有阿拉伯数字与字母的字符串,存在重复的字符,用以下哪一种容器可以最快的统计出每个字符出现的次数? A vector B set C map D hashtable #include #include #include #include using namespace std; int hash(int element) { return el原创 2012-03-19 11:27:06 · 688 阅读 · 0 评论 -
常用的排序算法分析
//插入排序 将P位置的元素插到前P+1个元素中的正确位置,保证在P位置的时候前面的 //的元素是处于排序状态 //时间复杂度O(N*N)的时间界 template void insertionSort(vector& a) { int j; for(size_t p = 1;p < a.size();p++) { Comparable temp = a[p];原创 2012-03-20 23:36:09 · 658 阅读 · 0 评论 -
常用数据结构和算法基础
template class List { private: struct Node //double link { Node(const Object& orig = Object(),Node* p = NULL,Node* d = NULL):mb(orig), prev(p原创 2012-03-22 22:28:07 · 1041 阅读 · 0 评论