数据结构
12月16日 周六
问题整理:
链表
栈的应用:斐波那契数列 字符串逆转 进制转换 括号匹配 表达式求值
循环队列
树 二叉树 遍历
赫夫曼树
新知识:
快速排序
/* Note:Your choice is C IDE */
#include "stdio.h"
int low,high,mid,key;
int one(int a[],int low,int high)
{
key=a[low];
while(low<high)
{
while(low<high&&key<a[high])
{
high--;
}
a[low]=a[high];
while(low<high&&key>a[low])
{
low++;
}
a[high]=a[low];
}
a[low]=key;
return low;
}
void two(int a[],int low,int high)
{
if(low<high)
{
mid=one(a,low,high);
two(a,low,mid-1);
two(a,mid+1,high);
}
}
void main()
{
int i;
int a[10]={2,4,6,1,7,9,3,5,0,8};
low=0;
high=9;
two(a,low,high);
for(i=0;i<10;i++)
{
printf("%d ",a[i]);
}
}
感悟:自律才能自由
得与失:最近状态不太好,今天周六本来准备去看电影调节一下,结果下午又学到了新东西,并且弄懂了新的排序,感觉状态又回来了。
人想表达的永远不是他所说的内容,而是渴望被理解的心情。
12月16日 周六
问题整理:
链表
栈的应用:斐波那契数列 字符串逆转 进制转换 括号匹配 表达式求值
循环队列
树 二叉树 遍历
赫夫曼树
新知识:
快速排序
/* Note:Your choice is C IDE */
#include "stdio.h"
int low,high,mid,key;
int one(int a[],int low,int high)
{
key=a[low];
while(low<high)
{
while(low<high&&key<a[high])
{
high--;
}
a[low]=a[high];
while(low<high&&key>a[low])
{
low++;
}
a[high]=a[low];
}
a[low]=key;
return low;
}
void two(int a[],int low,int high)
{
if(low<high)
{
mid=one(a,low,high);
two(a,low,mid-1);
two(a,mid+1,high);
}
}
void main()
{
int i;
int a[10]={2,4,6,1,7,9,3,5,0,8};
low=0;
high=9;
two(a,low,high);
for(i=0;i<10;i++)
{
printf("%d ",a[i]);
}
}
感悟:自律才能自由
得与失:最近状态不太好,今天周六本来准备去看电影调节一下,结果下午又学到了新东西,并且弄懂了新的排序,感觉状态又回来了。
人想表达的永远不是他所说的内容,而是渴望被理解的心情。