Linked Listing And Sorting

Document Details:
  • Uploaded: April, 7th 2015
  • Views: 108 Times
  • Downloads: 0 Times
  • Total Pages: 6 Pages
  • File Format: .pdf
  • File size: 269.58 KB
  • Uploader: amanda
  • Category: Miscellaneous
 add to bookmark | report abuse
#include <iostream>
struct node{
int value;
node * next;
};
void addekor(node *induk, node *anak){
node * temp = induk;
while (temp->next!=0){
temp = temp->next;
}
temp->next=anak;
}
int main()
{
int data[]={5,7,2,3,9,10,8,1,4,6};
node *induk, *temp;
induk = new node;
induk->value = data[0];
induk->next = 0;
for (int i=1; i<10 ; i++){
temp = new node;
temp->value=data[i];
temp->next=0;
addekor(induk,temp);
}
system("PAUSE");
return EXIT_SUCCESS;
}
Displaying 5 of 6 pages, to read the full document please DOWNLOAD.
Tags: