随笔分类 -  DataStructure&Algorithm

摘要:转自:http://cstheory.stackexchange.com/questions/19759/core-algorithms-deployed/19773#19773本文原始内容来源于stackexchange,遵循cc-wiki协议; 近日Emanuele Viola在 Stackexchange 上提了这样的一个问题,他希望有人能够列举一些目前软件、硬件中正在使用的算法的实际案例来证明算法的重要性,对于大家可能给到的回答,他还提出了几点要求:使用这些算法的软件或者硬件应该是被广泛应用的;例子需要具体,并给出确切的系统、算法的引用地址;在经典的本科生或者博士的课程中应该教过这些. 阅读全文
posted @ 2014-03-28 00:24 JasonScor 阅读(339) 评论(0) 推荐(0)
摘要:What’s a Hash Table? Why we need a Hash Table?By Using a Hash Table we can find element very quickly. For example, There are 20 random number in an array below.It’s not a sorted array, So We can not useBinary Searchto finding a number, When we need to find 118, We need 12 comparisons! Finding number 阅读全文
posted @ 2014-03-17 01:00 JasonScor 阅读(6118) 评论(0) 推荐(0)
摘要:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?class Solution{ int FindSingleNumber(int num[], int n) { if(NULL == num || n <= 0) ... 阅读全文
posted @ 2014-03-16 13:10 JasonScor 阅读(221) 评论(0) 推荐(0)
摘要:下面的几种排序算法都是非常经典的排序算法。1) 冒泡排序(Bubble Sort)2) 选择排序(Select Sort)3) 插入排序(Insert Sort)void Bubble_Sort(int Arr[], int nLen){ int i = 0; int j = 0; if (NULL == Arr || nLen Arr[j]) { Swap(Arr[i], Arr[j]); } } }} void Select_Sort(int Arr[], int nLen){ if (NULL == Arr || nLen Arr[j]) { nMin =... 阅读全文
posted @ 2014-01-03 22:00 JasonScor 阅读(243) 评论(0) 推荐(0)
摘要:出处:http://www.cnblogs.com/vameiHASH哈希表(hash table)是从一个集合A到另一个集合B的映射(mapping)。映射是一种对应关系,而且集合A的某个元素只能对应集合B中的一个元素。但反过来,集合B中的一个元素可能对应多个集合A中的元素。如果B中的元素只能对应A中的一个元素,这样的映射被称为一一映射。这样的对应关系在现实生活中很常见,比如:A->B人->身份证号日期->星座上面两个映射中,人->身份证号是一一映射的关系。在哈希表中,上述对应过程称为hashing。A中元素a对应B中元素b,a被称为键值(key),b被称为a的has 阅读全文
posted @ 2013-12-29 00:07 JasonScor 阅读(433) 评论(0) 推荐(0)
摘要:本文链接:http://www.raywenderlich.com/zh-hans/21503/a%E6%98%9F%E5%AF%BB%E8%B7%AF%E7%AE%97%E6%B3%95%E4%BB%8B%E7%BB%8D这篇blog是由iOS Tutorial Team的成员Johann Fradj发表的,他目前是一位全职的资深iOS开发工程师。他是Hot Apps Factory的创始人,该公司开发了App Cooker。学习A星寻路算法是如何工作的!你是否在做一款游戏的时候想创造一些怪兽或者游戏主角,让它们移动到特定的位置,避开墙壁和障碍物呢?如果是的话,请看这篇教程,我们会展示如何使 阅读全文
posted @ 2013-09-05 20:09 JasonScor 阅读(539) 评论(0) 推荐(0)