1 / 33
文档名称:

排序算法可视化.doc

格式:doc   大小:298KB   页数:33页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

排序算法可视化.doc

上传人:AIOPIO 2021/5/29 文件大小:298 KB

下载得到文件列表

排序算法可视化.doc

相关文档

文档介绍

文档介绍:排序算法可视化
摘 要:排序是计算机程序设计中的一种重要操作,它的功能是将一个数据元素(或记录)的任意序列,重新排列成一个按关键字有序的序列。排序的方法有很多,但就其全面性能而言,很难提出一种被认为是最好的方法,每一种方法都有各自的优缺点,适合在不同的环境(如记录的初始排列状态等)下使用。本论文主要讨论七种排序算法,即直接插入排序,简单选择排序,冒泡排序,冒泡排序改进算法一,二,,对象由随机生成,无需人工干预来选择或者输入数据。比较的指标为关键字的比较次数和关键字的移动次数。
关键词: 直接插入排序,简单选择排序,冒泡排序,冒泡排序改进算法快速排序,归并排序
 
      ﻩ   Sorting algorithm visualization
LI Chen Xing
(School of computer and Software engineering XiHua University.,Chengdu 610065 China)
Abstract:Sorting is a computer programming is an important operation , and its function is a data element ( or record ) in any sequence , rearranged an ordered sequence by keyword 。 There are a lot of sort of way, but its overall performance , it is hard proposed method is considered to be the best , each method has its own advantages and disadvantages , suitable for different environments ( such as the initial alignment state record etc。) use . This paper focuses on seven kinds of sorting algorithms , namely, direct insertion sort, simply select sort, bubble sort , bubble sort algorithm is an improvement , two , quick sort and merge sort . Paper we create objects with DirectX, the object is generated by random , without human intervention to select or enter data. Compare the number of key indicators to compare the number of keywords and mobile .
Keywords: bubble sort, simple selection sort, quick sort,merge sort,straight insert sort.
     1数据结构设计
1。
在计算机所描绘的3D世界中,所有的物体模型(如树木,人物,山峦)都是通过多边形网格来逼近表示的,这些多边形可以是三角形,也可以是四边形。任何物体都可以用三角形网格来逼近表示,三角形网格是构建物体模型的基本单元。众所周知,一个三角形有三个顶点,为了能够通过大量的三角形组成三角形网格来描述物体,首先需要定义好三角形的顶点(Vertex),三个顶点确定一个三角形,而顶点除了定义每个顶点的坐标位置以外,还含有颜色等其他属性。在Direct3D中,顶点的具体表现形式是顶点缓存(Vertex Buffer),(Flexible Vertex Format,FVF)来描述三角形网格的每个顶点。
1。2顶点缓存使用
1.2。1设计顶点缓存
struct stD3DVertex
{
float x, y, z, rhw;//顶点的三维坐标值,x,y,z,以及rhw值(包含经过坐标变换的顶点坐标值)
unsigned long color;//顶点的颜色值
};
stD3DVertex objData[300];//顶点数组
#define D3DFVF_VERTEX (D3DFV