
数据结构
文章平均质量分 61
vvickey11
一个热爱计算机,喜欢不断面对困难,迎接挑战的孩纸!↖(^ω^)↗,哈尔滨工业大学硕士在读
展开
-
计蒜客 数据结构 Queue
//数据结构--C++--队列//队列的定义、插入、删除#include using namespace std;class Queue{ private: int* data; int head, tail, length; public: Queue(int length_input){ //开辟原创 2016-08-11 17:10:00 · 430 阅读 · 0 评论 -
华为20170317实习机试答案
五福#include#include//集齐五福多少套//给出0 1 序列using namespace std;int fu(string &str){ //cout << str << endl; int matrix[6]={0}; //int people_num = 1; int fu_num = 1; for (auto i : str){ if (i ==原创 2017-03-18 17:18:17 · 1491 阅读 · 0 评论 -
KMP next nextval
next用于:查看模式串自己的对称情况,计算方法next计算:p代表字符串,j代表当前指向的字符0 , 当j = 1时 next[j] = Max{k| 1 1,其他情况nextval用于:当出现:aaab模式串,aaaxcvba待匹配串,的情况下由于模式串前几个字符一样,所以总是回溯,所以为避免这种情况采用nextvalnextval计算:明确概念,j指示原创 2016-11-28 16:47:20 · 419 阅读 · 0 评论 -
Leetcode Parlindrome Number 9
//解题思路,回文数就是1234321//分别提取最高位和最低位的数进行比较#include using namespace std;////这个处理不了溢出//class Solution{//public:// bool isParlindrome(int x){// int nTen = 1;// int high = 0;//原创 2016-10-25 14:43:04 · 422 阅读 · 0 评论 -
codeblocks 安装注意
codeblocks有的不带有MinGW,需要自行安装。1.首先去下载对应的32位或者64位的MinGW。2.解压即可没有什么安装,记得文件位置。3.改变环境变量的Path,路径是刚才的MinGW下bin文件位置。记得在cmd里测试一下gcc -v用这个命令。4.然后下载codeblocks,在settins里边的compiler settings里边找到tool ...什么的,然原创 2016-08-14 20:59:18 · 428 阅读 · 0 评论 -
计蒜客 数据结构 栈 模板倒水问题
//单调递减栈//题目://我们来看看这样一道题:地上从左到右竖立着 n 块木板,从 1 到 n 依次编号,(10,5,8,12,6)//如下图所示。我们知道每块木板的高度,在第 n 块木板右侧竖立着一块高度无限大的木板,//现对每块木板依次做如下的操作:对于第 i 块木板,我们从其右侧开始倒水,//直到水的高度等于第 i 块木板的高度,倒入的水会淹没 ai 块木板(如果木板左右两侧水的原创 2016-08-12 15:20:26 · 746 阅读 · 0 评论 -
计蒜客 数据结构 栈 数列翻转
//数据结构 栈 数列翻转#include#include#includeusing namespace std;template class Stack {private: Type *urls; int max_size, top_index;public: Stack(int length_input) { urls = new Type原创 2016-08-11 22:08:19 · 452 阅读 · 0 评论 -
计蒜客 数据结构 栈 stack_expression C++
//stack_expression//只处理加法和乘法的用栈实现的表达式求值,表达式长度为n//表达式输入的中间不能有空格#include#include#includeusing namespace std;template class Stack {private: Type *urls; int max_size, top_index;public:原创 2016-08-11 22:01:33 · 717 阅读 · 2 评论 -
计蒜客 数据结构 链表 ——应用筛选简历 C++
//这个程序是,没有头节点的//2016/08/10#includeusing namespace std;class Node {public: int data; Node* next; Node(int _data) { data = _data; next = NULL; }};class LinkList {原创 2016-08-11 17:20:24 · 711 阅读 · 0 评论 -
计蒜客 数据结构 顺序表 C++
#include #include using namespace std;class Vector {private: int size, length; int *data;public: Vector(int input_size) { size = input_size; length = 0; data =原创 2016-08-11 17:18:00 · 686 阅读 · 0 评论 -
计蒜客 数据结构 链表——约瑟夫环 C++
#includeusing namespace std;class Node {public: int data; Node* next; Node(int _data) { data = _data; next = NULL; }};class LinkList {private: Node* head;pub原创 2016-08-11 17:11:20 · 821 阅读 · 0 评论 -
计蒜客 数据结构 队列——循环队列 C++
//循环队列的操作#include #include using namespace std;class Queue {private: int *data; int head, tail, length, count;public: Queue(int length_input) { data = new int[length_input];原创 2016-08-11 17:13:59 · 358 阅读 · 0 评论 -
计蒜客 数据结构 链表 C++
//链表的插入insert()和删除delete_node()还有输出,翻转everse()#includeusing namespace std;class Node {public: int data; Node* next; Node(int _data) { data = _data; next = NULL; }}原创 2016-08-11 17:12:41 · 625 阅读 · 0 评论 -
红黑树讲解,觉得很通俗易懂的链接
红黑树性性质左旋右旋点击打开链接红黑树的插入点击打开链接原创 2017-03-12 20:18:36 · 1350 阅读 · 0 评论