thread processor
concurrent queue testing
两个字符串A、B。从A中剔除存在于B中的字符。比如A=“hello world”,B="er",那么剔除之后A变为"hllowold"。空间复杂度要求是O(1),时间复杂度越优越好。使用哈希解决
/*This is a free Program, You can modify or redistribute it under the terms of GNU*Description:给定一个字符串,输出它的全排列, 如给定字符串abc,输出abc,bac,bca,acb,cab,cba共6种序列*Language: C++*Development Environment:
题目:面试官问,我们阿里巴巴公司收到了很多简历,比如说是百万级别的简历,你能不能设计一个算法,让我输入一个姓,程序输出所有这个姓的人,比如我输入张,输出是张三,张四等等设计思路: 设计思路见代码:/*This is a free Program, You can modify or redistribute it under the terms of GNU*Descrip
代码: /*This is a free Program, You can modify or redistribute it under the terms of GNU*Description: 随机数发生器,指定一个数,比如1000,要求随机产生1到1000之间的 任意数,并且1到1000之间任何一个数产生的概率是相等的,都是1/1000*Language:
1. KM算法:百度http://baike.baidu.com/view/739278.htm2. 我对KM算法的看法:我觉得KM算法有错误,它是先构
https://github.com/wangzhicheng2013/thread_class
https://github.com/wangzhicheng2013/json_tools
https://github.com/wangzhicheng2013/log_system/tree/master/log4cxx
快速字符识别
使用二叉树的层次遍历改造二叉链表
一 问题描述一个字符数组,里面的字符可能是a-z、A-Z、0-9.现在要求对数组进行排序,要求所有小写字符放在最前面,所有大写字符放在中间,所有数字放在最后,而且各部分内部分别有序。二 解题思路方法一 利用快排如图所示,为了能够实现排序,首先将原始字符串进行一次二次划分,将所有小写字符移动到字符串的最开始,然后对此段子序列进行快速排序,然后依据同样的方法对大写字符和数字字符进行排序。方法二:如图所
使用一种算法来加速查找素数
“一步千里”之数组找数
#include #include #include using namespace std;/*This is a free Program, You can modify or redistribute it under the terms of GNUe: C++*Development Environme
消息队列和共享内存方式分别实现父子进程的通信
/*This is a free Program, You can modify or redistribute it under the terms of GNU*Description: 给定一定的范围和定时,如给
一 检查字符串是否为整数,是则输出该整数#include #include #include using namespace std;const int max = 10;bool chet = str.begin(), i = 0; i
#include <iostream>#include <fstream>int main() { std::ifstream ifs("./test.cpp"); if (ifs) { std::ofstream ofs("./test1.cpp"); if (ofs) {
thread body
zmq ipc
sort strings in a file with multiple thread and stl sort and heap merge
1.问题描述在一个字符串 0
本人有幸参加在清华大学举办的2013年百度
一 问题描述:一个单词单词字母交换,可得另一个单词,如army->mary,成为兄弟单词。提供一个单词,在字典中找到它的兄弟。描述数据结构和查询过程。二 解题思路: 本题有两个关键点:第一,如何设计英语字典的数据结构?第二,如何查找兄弟单词? 1. 设计英语字典的数据结构 如图,可以采用哈希链表的形式组织字典
一:问题描述:输入一字符串,显示其非重复的全排列二:设计思路:递归实现,比如字符串abb,设计一个指针pBegin指
一 问题描述:输入字符串,如abcde,求它的3的组合二:代码/*This is a free Program, You can modify or redistribute it under the terms of GNU*Description:字符串组合递归求解*Language: C++*Development Environment: VC6.0*Author: Wangzhichen
一 Trie树可参照百度百科: http://baike.baidu.com/view/1436495.htm 二 Trie树的构造及应用/*This is a free Program, You can modify or redistribute it under the terms of GNU*Description:Trie树及其应用*Language: C++*Dev
一 问题描述定义字符串的左旋转操作:把字符串前面的若干个字符移动到字符串的尾部。如把字符串abcdef 左旋转2 位得到
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号