
c语言
宾灬
这个作者很懒,什么都没留下…
展开
-
栈的链式存储实现
///**栈的链式存储实现**/#include <stdlib.h>#include <stdio.h>/** * 链表节点 */typedef struct stack_node{ int data; struct stack_node * next;} StackNode;/** * 栈 */typedef struct ...原创 2019-07-24 17:03:00 · 249 阅读 · 0 评论 -
c语言实现霍夫曼编码
//// 霍夫曼编码// #include <stdio.h>#include <stdlib.h>#include <string.h> /**思路:用一个有序链表(从大到小)来保存节点,然后通过链表来构造霍夫曼树, 再由霍夫曼树得到霍夫曼编码**/ typedef struct huffman_tree_node{ int we............原创 2019-07-24 17:01:21 · 3717 阅读 · 0 评论 -
leetcode题目字符串转数字
/** * 字符串转数字 */#include <iostream>#include <string>using namespace std;/** * 字符串转数字 * @param str * @return */int str_to_num_50(string str){ bool flag = false; //是否是负数 ...原创 2019-03-13 10:14:03 · 273 阅读 · 0 评论 -
查找字符串不含有重复字符的 最长子串 的长度
查找字符串不含有重复字符的 最长子串 的长度int lengthOfLongestSubstring(string s) { int res = 0, left =0, right = 0;//三个变量,返回结果,子串的左边界,子串的右边界 set<char> tempSet;//set集合代表滑动窗口 while (right < s.length()...原创 2019-03-13 10:11:05 · 298 阅读 · 0 评论