随笔分类 -  算法

摘要:void quickSort(int(&arr)[BUFSIZ],int start,int end){ int key=arr[start]; int p1=start; int p2=end; if(end=key && arr[p2]2){ ... 阅读全文
posted @ 2016-01-04 10:00 SKY_VIEW 阅读(659) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include #include #include #include #include #include #include using namespace std;#define BUFSIZ 100int (&strToIntArr(string s,int... 阅读全文
posted @ 2016-01-02 21:17 SKY_VIEW 阅读(169) 评论(0) 推荐(0)
摘要:CODE#include #include #include #include #include using namespace std;struct Point { double x, y;};double cross(const Point &A, const Point &B, const P... 阅读全文
posted @ 2014-08-22 10:34 SKY_VIEW 阅读(506) 评论(0) 推荐(0)
摘要:分页管理机制(线性地址转换到物理地址)作者:谭杭波.MP480386开始支持存储器分页管理机制。分页机制是存储器管理机制的第3二部分。段管理机制实现虚拟地址(由段和偏移构成的逻辑地址)到线性地址的转换,分页管理机制实现线性地址到物理地址的转换。如果不启用分页管理机制,那么线性地址就是物理地址。本文将... 阅读全文
posted @ 2013-09-28 07:34 SKY_VIEW 阅读(1499) 评论(0) 推荐(0)
摘要:#include #include using namespace std;typedef struct node{ int key; node* lchild; node* rchild; node* parent; int color; int flag;} *PNODE,NODE;//Crea... 阅读全文
posted @ 2013-09-05 22:44 SKY_VIEW 阅读(568) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include #include #include typedef struct treenode{ int key; int priority; int flag; treenode* parent; treenode* lch... 阅读全文
posted @ 2013-08-20 17:21 SKY_VIEW 阅读(362) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include #include #include typedef struct node{ int headvex; int tailvex; node* headlink; node* taillink;}arcnode,*parc... 阅读全文
posted @ 2013-08-19 21:00 SKY_VIEW 阅读(864) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-12 22:40 SKY_VIEW 阅读(312) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-12 06:29 SKY_VIEW 阅读(432) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-11 22:18 SKY_VIEW 阅读(460) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-09 19:01 SKY_VIEW 阅读(530) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-09 11:55 SKY_VIEW 阅读(428) 评论(0) 推荐(0)
摘要:var arry= new Array();var nums= new Array();var snum;function numchain(){snum=0;for(var i=0;i 阅读全文
posted @ 2013-08-08 20:47 SKY_VIEW 阅读(425) 评论(0) 推荐(0)
摘要:1.递归定义的函数在汇编层面很好理解,函数执行过程中对自身的调用实际上是指令的跳转,遇到调用自身的时候指令跳转到函数体的开始位置继续执行,这种跳转不可避免的打断当前函数的执行过程,当跳转部分的指令执行完毕,当前函数的执行过程又被恢复,这一恢复过程就用到了系统的栈,跳转发生之前,函数的相关参数已经保存... 阅读全文
posted @ 2013-08-08 19:43 SKY_VIEW 阅读(550) 评论(0) 推荐(0)
摘要:用链表存放队列,书上是用的伪指针,比较关键的一点是队列头部到达块的上限时,继续压入元素,会导致伪指针指向块的起始位置,链表无需顾忌这个问题#include using namespace std; struct strqueue;typedef struct strqueue *StrQueue;S... 阅读全文
posted @ 2013-08-08 19:27 SKY_VIEW 阅读(401) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#includeusing namespace std;struct arc{int vertex;arc *nextarc;};struct vnode{int vertex,visited;arc *firstarc;};struct G{vnode adj... 阅读全文
posted @ 2013-08-08 06:38 SKY_VIEW 阅读(511) 评论(0) 推荐(0)
摘要:#include #include using namespace std;//创建大顶堆void build_heap(int a[],int len){ int i=len; bool f=false; while((i*2)>len) { int j=i; while(j!=1) { ... 阅读全文
posted @ 2013-08-06 20:40 SKY_VIEW 阅读(223) 评论(0) 推荐(0)
摘要://算法核心思想并不难理解,即取一个值作为参考值,大于等于参考值的放在一边,小于参考值的放在另一边//程序实现的核心是对两个指针的操作,针对每一个无序的块使用两个指针,一个从左向右滑动,另一个相反,//向右滑动的指针如果碰到一个大于参考值的数,则另一个指针开始向右滑动,直到找到一个小于参考值的数,然... 阅读全文
posted @ 2013-07-31 23:34 SKY_VIEW 阅读(369) 评论(0) 推荐(0)