xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 5KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-22
  • 語言: C/C++
  • 標簽: C/C++??DoubleLinked??

資源簡介

用C語言實現雙向列表的創建,刪除,添加節點,刪除節點,插入節點,遍歷節點,打印節點,并結合插入排序法實現了基于雙向鏈表的升序排序。

資源截圖

代碼片段和文件信息

#include?“List.h“

//file?option?port
void?InsertSortlinked(char?*inputfile?char?*outputfile)
{
FILE?*in;
FILE?*out;?
int?data[100];
int?ii?=?0;
List?myList?=?newList();

if?((in?=?fopen(inputfile?“r“))?==?NULL)?/*?open?file?TEST.txt?*/
{
fprintf(stderr?“Cannot?open?output?file.\n“);
return?;
}

if?((out?=?fopen(outputfile?“w“))?==?NULL)?/*?open?file?TEST.txt?*/
{
fprintf(stderr?“Cannot?open?output?file.\n“);
return?;
}

while?(!(feof(in)))
{
fscanf(in?“%d“?&data[ii]);
append(myListdata[ii]);
ii++;
}

InsertSort(myList);
printfList(myList);
printList(out?myList);
freeList(myList);
fclose(in);
fclose(out);
}

//Insert?Sort?of?Double-link?List?
void?InsertSort(List?L)
{
Node?n1n2tmppos;
int?i;

n1?=?getFront(L);
n2?=?getNextNode(n1);

for?(i=1;?isize;?++i)
{
pos?=?NULL;
tmp?=?n2;
//compare
? while(n1?&&?(n1->data?>?tmp->data))
{

pos?=?n1;
n1?=?getPrevNode(n1);
}

//iter
n2?=?getNextNode(n2);

//insert?and?delete
if?(pos?!=?NULL)
{
insertBefore(L?pos?tmp->data);
detachNode(L?tmp);
}
//iter
n1?=?getPrevNode(n2);
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????????25??2019-02-26?15:13??linux\in.txt

?????文件???????1140??2019-02-26?15:13??linux\InsertSortlinked.c

?????文件???????5009??2019-02-26?15:13??linux\List.c

?????文件???????5012??2019-02-26?15:13??linux\List.h

?????文件???????1380??2019-02-26?15:13??linux\ListClient.c

?????文件????????346??2019-02-25?19:39??linux\Makefile

?????文件?????????26??2019-02-26?19:40??linux\out.txt

????..AD...?????????0??2019-02-26?19:43??linux

-----------?---------??----------?-----??----

????????????????12938????????????????????8


評論

共有 條評論