
数据结构
文章平均质量分 67
数据=结构相关知识
池塘的蜗牛
无线通信物理层工程师
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
JUmp_II
/************************************************************************* > File Name: JUmp_II.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 15时42分47秒 > Description:Given an array of原创 2014-08-25 16:16:01 · 407 阅读 · 0 评论 -
Binary Tree Maximum Path Sum
/************************************************************************* > File Name: Binary_Tree_Maximum_Path_Sum.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 10时41分17秒 ************原创 2014-08-25 11:11:31 · 479 阅读 · 0 评论 -
Letter Combinations of a Phone Number
/************************************************************************* > File Name: Letter_Combinations_of_a_Phone_Number.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 11时17分45秒 ***原创 2014-08-25 11:41:48 · 414 阅读 · 0 评论 -
Longest_Palindromic_Substring
/************************************************************************* > File Name: Longest_Palindromic_Substring.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 15时27分55秒 ***********原创 2014-08-24 22:47:30 · 435 阅读 · 0 评论 -
N-Queue
/************************************************************************* > File Name: N-Queue.cpp > Author: > Mail: > Created Time: 2014年08月26日 星期二 15时00分40秒 >Description:原创 2014-08-26 15:55:19 · 491 阅读 · 0 评论 -
Gas Station
对于该问题大家可以参考:http://blog.youkuaiyun.com/lanxu_yy/article/details/17241891该文章给出了两种原创 2014-08-26 11:53:05 · 445 阅读 · 0 评论 -
Jump
/************************************************************************* > File Name: Jump.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 15时20分37秒 >Description: Given an array of no原创 2014-08-25 15:33:12 · 392 阅读 · 0 评论 -
Convert_Sorted_Array_to_Binary_Search_Tree
/************************************************************************* > File Name: Convert_Sorted_Array_to_Binary_Search_Tree.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 22时42分11秒原创 2014-08-25 23:04:15 · 468 阅读 · 0 评论 -
Word Search
/************************************************************************* > File Name: Word_Search.cpp > Author: > Mail: > Created Time: 2014年08月26日 星期二 16时21分30秒 >Descript原创 2014-08-26 17:10:43 · 508 阅读 · 0 评论 -
Valid_Parentheses.cpp
/************************************************************************* > File Name: Valid_Parentheses.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 14时54分19秒 ***********************原创 2014-08-24 22:52:16 · 347 阅读 · 0 评论 -
Flatten_Binary_Tree_to_Linked_List
/************************************************************************* > File Name: Flatten_Binary_Tree_to_Linked_List.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 1原创 2014-08-24 22:46:11 · 170 阅读 · 0 评论 -
Sort_Color类似于快速排序
参考:http://blog.youkuaiyun.com/lanxu_yy/article/details/11907615原创 2014-08-26 11:25:39 · 490 阅读 · 0 评论 -
leetcode声明
对于本模块的所有实现个人没有在leetcode原创 2014-08-26 17:17:53 · 504 阅读 · 0 评论 -
Climbing Stairs
/************************************************************************* > File Name: Climbing_Stairs.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 09时37分23秒 *************************原创 2014-08-25 09:45:12 · 346 阅读 · 0 评论 -
Longest Consecutive Sequence
/************************************************************************* > File Name: Longest_Consecutive_Sequence.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 10时05分02秒 ************原创 2014-08-25 10:35:08 · 355 阅读 · 0 评论 -
Sum_Root_to_Leaf_Numbers
/************************************************************************* > File Name: Sum_Root_to_Leaf_Numbers.cpp > Author:zh > Mail: 920282161@qq.com > Created Time: 2014年08月23日 星期六 22时50分38秒原创 2014-08-24 22:52:40 · 357 阅读 · 0 评论 -
Best_Time_to_Buy_and_Sell_Stock
/************************************************************************* > File Name: Best_Time_to_Buy_and_Sell_Stock.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 16时3原创 2014-08-25 16:54:10 · 463 阅读 · 0 评论 -
Path_SUM
/************************************************************************* > File Name: Path_SUM.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 14时21分55秒 ********************************原创 2014-08-24 22:51:23 · 304 阅读 · 0 评论 -
Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.原创 2014-08-26 16:07:26 · 405 阅读 · 0 评论 -
Path_Sum
/************************************************************************* > File Name: Path_Sum.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 13时40分40秒 ********************************原创 2014-08-24 22:50:17 · 348 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II
该解来自与Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you lik转载 2014-08-25 17:04:45 · 449 阅读 · 0 评论 -
Populating_Next_Right_Pointers_in_Each_Node
/************************************************************************* > File Name: Populating_Next_Right_Pointers_in_Each_Node.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 21时14分31原创 2014-08-25 22:12:12 · 435 阅读 · 0 评论 -
Longest_Palindromic_Substring
/************************************************************************* > File Name: Flatten_Binary_Tree_to_Linked_List.cpp > Author: > Mail: > Created Time: 2014年08月24日 星期日 15时59分18秒 ******原创 2014-08-24 22:46:32 · 377 阅读 · 0 评论 -
Longest_Substring_Without_Repeating_Characters
/************************************************************************* > File Name: Longest_Substring_Without_Repeating_Characters.cpp > Author: > Mail: > Created Time: 2014年08月25日 星期一 14时38原创 2014-08-25 15:14:05 · 408 阅读 · 0 评论 -
在一个字符串中找到第一个只出现一次的字符
问题描述:题目:在一个字符串中找到第一个只出现一次的字符。如输入abaccdeff,则输出b。 分析:这道题是2006年google的一道笔试题。对于这道题我们可以采用我对华为那道面试题分析时,扩展部分所运用的方法:哈希算法,在加上伴随数组。代码如下:void find(char a[]){ int temp[26] = {0}; //用于哈希运算统计每个字母出现的次序原创 2013-09-26 23:34:49 · 473 阅读 · 0 评论 -
动态规划4(最短编辑距离)
最短编辑距离(ga)原创 2014-04-10 11:03:48 · 815 阅读 · 0 评论 -
动态规划5(常见面试题)
1,最大字串之和:这个原创 2014-04-11 11:58:37 · 1499 阅读 · 0 评论 -
并查集
朋友圈假如已知有n个人和m对好友关系,如果两个人是直接或者间接有好友关系,则认为他们属于同一个朋友圈。写程序判断里面有多少朋友圈。例如 n = 5, m = 3 r = {(1,2), (2, 3), (4, 5)} 1 2 3 是一个朋友圈, 4 5 是一个朋友圈。所以输出是2. 上述问题原创 2014-04-08 21:25:04 · 411 阅读 · 0 评论 -
使用priority _queue 对Dijkstra进行优化
对于图的相关算法如最小生成树的Kruskal,Prim算法,最短路径的Dijkstra算法都采用的是贪心算法,而贪心算法最好的辅助工具个人认为就是priority_queue.所以本文将运用priority_queued对算法导论中Dijkstra算法进行优化。对于Dijkstra算法我们先给出算法导论中所给出基本算法实现。int a[5][5] = { {MAX2,10,M原创 2014-04-22 15:43:18 · 1664 阅读 · 0 评论 -
排列组合的相关问题
参考:http://blog.youkuaiyun.com/morewindows/article/details/7370155,《剑指offer》等.1,全排列问题:给定一组数据求其全排列.为方便起见,用123来示例下。123的全排列有123、132、213、231、312、321这六种。首先考虑213和321这二个数是如何得出的。显然这二个都是123中的1与后面两数交换得到的。然后可以将12原创 2013-11-07 10:43:08 · 613 阅读 · 0 评论 -
将一个数组划分为和最接近的连个集合
这个问题来源于《编程之美》原创 2014-04-12 10:23:41 · 1654 阅读 · 0 评论 -
后缀树及其应用
参考:http://blog.youkuaiyun.com/v_july_v/article/details/6897097原创 2014-04-13 22:15:38 · 627 阅读 · 0 评论 -
兄弟单词
转自:http://blog.youkuaiyun.com/doc_sgl/article/details/9277225转载 2014-08-27 17:11:49 · 559 阅读 · 0 评论 -
百度面试题:POJ 2192 - Zipper
转自:http://www.ahathinking.com/archives/173.html转载 2014-08-27 17:20:46 · 470 阅读 · 0 评论 -
面试题:从给定的N个正数中选取若干个数之和最接近M
如题,并输出该子序列测试用例:2,9,5,7,4,11,10分别输出最接近33、40、47、60的子序列分析:N个数之和接近M,将M看做一个容量的背包,这个题目就变成了典型的01背包,M容量下求最优解并输出最优方案,这在01背包中都整理过,上代码:转载 2014-08-27 22:21:50 · 2268 阅读 · 0 评论 -
随机洗牌问题
将一副牌随机打乱:原创 2014-08-30 15:43:31 · 1056 阅读 · 0 评论 -
2014微软在线编程试题(1,2)
1DescriptionFor this question, your program is required to process an input string containing only ASCII characters between ‘0’ and ‘9’, or between ‘a’ and ‘z’ (including ‘0’, ‘9’, ‘a’, ‘z’).Y原创 2014-04-15 11:42:33 · 757 阅读 · 0 评论 -
运用优先队列实现后缀数组的排序
后缀数组实现原理的原创 2014-04-18 11:16:44 · 614 阅读 · 0 评论 -
动态规划(3)
本来这次是要学习字符串的最短编辑距离的,但是由于最近正在研究《linux服务器高性能编程》以及实验室项目验收,所以没有时间对这个进行深入理解,所以暂时搁置一段时间,这次来学习一下0-1背包问题,以及找零问题。对于这两个问题都属于动态规划的经典问题。0-1背包问题:假如有容量为10(克)的包和重量为3,4,5(克)的物品,每件物品的价值为4,5,6.先求在容量不超过10克的情况下,包中物品的原创 2014-03-22 16:13:05 · 482 阅读 · 0 评论 -
大数运算的基本处理方法
参考:《剑指offer》以及网络相关博客。对于大数超过我们所有数据类型所能表达的范围时,我们将其称为大数。对此我们的统一处理方法就是将其转换数组来处理,下面我们将通过两个实例展示此类问题的处理方法。1,大数相乘:如果两个数据特别大,那么当其相乘之后数据将会更大,这样我们采用上述的大数处理方法:直接上代码:/*1,大数相乘的主要思想是将两个大数以字符串的形式表示按照字符串的形原创 2013-10-30 20:35:15 · 1016 阅读 · 0 评论