04 2015 档案

摘要:关于C++的内存处理,可分为三大块,分别是:(一)内存管理机制 (二)内存泄露处理(三)内存回收机制这篇文章将就(一)内存管理机制 进行深入探讨,如有错误欢迎大家指正。C++的内存管理也可细分为1. 程序内存布局2. 内存的分配方式3. 常见内存错误及对策----------------------... 阅读全文
posted @ 2015-04-29 09:42 jasmine_turnsoul 阅读(3870) 评论(0) 推荐(0)
摘要:(一)数组与指针本质是不同的。如下图所示char a[]="hello";char *p="hello";上述代码的初始化结果如下图所示:a就是一个数组变量,表示整个数组。p是一个指针变量,存储的值是地址。数组变量a和指针变量p,都存储在用户栈中。而表达式char *p=”hello“中的”hell... 阅读全文
posted @ 2015-04-22 02:08 jasmine_turnsoul 阅读(281) 评论(0) 推荐(0)
摘要:1. A*算法2.BFS3.Dijkstra: (1)fibonacci 堆 (2) heap 堆4.启发式搜索算法5.遗传算法 阅读全文
posted @ 2015-04-22 00:56 jasmine_turnsoul 阅读(182) 评论(0) 推荐(0)
摘要:1. 朴素算法:即暴力法缺点在于,未能充分利用位移s所提供的信息。比如p=aaab,发现位移s=0是有效的。则位移1,2,3都不是有效位,因为T[4]=b。时间复杂度:O((n-m+1)m)2. rabin-karp利用的是数论: 若a==b, 则 a≡b(mod q) ; 若a≠b(mod q),... 阅读全文
posted @ 2015-04-21 23:13 jasmine_turnsoul 阅读(389) 评论(0) 推荐(0)
摘要:来自: http://blog.csdn.net/on_1y/article/details/13030439 (这篇介绍的非常到位和透彻!!!)char *p="hello";char q[]="hello";char *r = (char*)malloc(sizeof(char)*6);我们知道... 阅读全文
posted @ 2015-04-21 16:03 jasmine_turnsoul 阅读(168) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-04-19 14:27 jasmine_turnsoul 阅读(204) 评论(0) 推荐(0)
摘要:思路:前后两个指针。又一次bug free!(但是速度慢。待我想想有什么更好解法么?或者是 判断可以优化?果真!判断isCharEqual(c1,c2)时,可以优化。不需要判断c1到底是大写还是小写)如下面。 bool isCharEqual(char c1, char c2){ ... 阅读全文
posted @ 2015-04-19 13:05 jasmine_turnsoul 阅读(117) 评论(0) 推荐(0)
摘要:Write a function to find the longest common prefix string amongst an array of strings.思路:这道题其实很简单。只不过一开始我就想复杂了,一看求Longest,就联想到DP。然后又联想到Set来求交并。后来,突然想到... 阅读全文
posted @ 2015-04-19 11:58 jasmine_turnsoul 阅读(136) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/hguisu/article/details/7856239值得详细看! 阅读全文
posted @ 2015-04-19 00:38 jasmine_turnsoul 阅读(68) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/gogly/articles/2353804.html总结的方法值得详看! 阅读全文
posted @ 2015-04-19 00:37 jasmine_turnsoul 阅读(120) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/hguisu/article/details/7880288此文很不错。Bit map 应用 1)可进行数据的快速查找,判重,删除,一般来说数据范围是int的10倍以下。 2)去重数据而达到压缩数据 阅读全文
posted @ 2015-04-18 23:56 jasmine_turnsoul 阅读(120) 评论(0) 推荐(0)
摘要:在找到满意的实习、满意的工作之前,我已经做好全年无休的准备了!!!现在只要给点信心,我就干劲十足!这段时间的经历,也让我切身意识到自信心的重要性。自信与压力的共同作用才能带来源源不断的动力。就用这句签名,来记录我这段时期的状态吧!"纵经寒彻骨,莫愁路漫漫,千磨万击还坚劲,我心依旧望苍穹" 阅读全文
posted @ 2015-04-18 20:44 jasmine_turnsoul 阅读(97) 评论(0) 推荐(0)
摘要:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-04-11 18:01 jasmine_turnsoul 阅读(130) 评论(0) 推荐(0)
摘要:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to ... 阅读全文
posted @ 2015-04-11 18:00 jasmine_turnsoul 阅读(157) 评论(0) 推荐(0)
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-04-01 19:40 jasmine_turnsoul 阅读(135) 评论(0) 推荐(0)
摘要:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.思路:任何... 阅读全文
posted @ 2015-04-01 19:38 jasmine_turnsoul 阅读(145) 评论(0) 推荐(0)