# data[].attributes.body
#include <iostream>
using namespace std;

struct NODE {

int number;
NODE*next;
}*headptr;

void ciptasenaraikosong();
void insertData();
void paparData();

int main(){

ciptasenaraikosong();
insertData();
paparData();

}void ciptasenaraikosong(){
headptr=NULL;

}
void insertData(){
NODE*newptr,*currptr,*prvptr;

int nilai;

cout<<"enter the data"

cin>>nilai;

newptr=new NODE;

newptr->number=nilai;

newptr->next=NULL;

if(headptr==NULL)

headptr==newptr;

else{

prevptr = NULL;

currptr = headptr;

while(currptr!=NULL && (newptr->number >currptr->number)){}

prevptr= currptr;

cout<<currptr->number;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

# data[].attributes.attachment_link.readable_text
#include <iostream>
using namespace std;

void ciptasenaraikosong();
void INSERTDATA();
void PAPARDATA();

struct NODE
   { 
   int number;
   NODE *next;
   };
   
NODE*headptr;

int main(){
   ciptasenaraikosong();
   INSERTDATA();
   INSERTDATA();
   INSERTDATA();
   PAPARDATA();
 }
   void ciptasenaraikosong(){
   headptr = NULL;
   
 }
   void INSERTDATA(){
      NODE *newptr, *preptr, *currptr;
      int nilai;
      cout<<"Masukkan Data :";
      cin>>nilai;
   
   newptr = new NODE;
   newptr->number =nilai;
   newptr->next =NULL;
   cout<<newptr -> number;
   
   if (headptr==NULL)
      headptr==newptr;
   else{
      preptr = NULL;
      currptr = headptr;
   while((currptr!=NULL)&&(newptr->number>currptr->number)){
   
   preptr = currptr;
   cout<< currptr -> number;
   currptr = currptr->next;
   }
   //while
   if(preptr == NULL)
   {
      newptr->next = headptr;
      headptr == newptr;
      }
   else{
      newptr -> next = currptr;
      preptr -> newptr;
   }  
   }
   }
   
   void PAPARDATA(){
         NODE *currptr;
         currptr = headptr;
         
   if(currptr == NULL)
   cout << "Senarai Kosong: ";
   else{
      while(currptr! =NULL){
      cout<<currptr->number;
      currptr = currptr -> next;
   }
   }
   }

# data[].attributes.body
#include<iostream> using namespace std; struct NODE{ int number; NODE *next; }* headptr; void ciptasenaraikosong(); void insertData(); void paparData(); int main(){ ciptasenaraikosong(); insertData(); insertData(); insertData(); paparData(); } void ciptasenaraikosong(){ headptr = NULL; } void insertData(){ NODE * newptr, *currptr, *prevptr; int nilai; cout<<" Masukkan data"; cin>>nilai; newptr = new (NODE); newptr->number = nilai; newptr->next= NULL; if(headptr==NULL) headptr== newptr; else{ prevptr = NULL; currptr = headptr; while(currptr!=NULL && (newptr->number >currptr->number)){ prevptr= currptr; cout<<currptr->number; currptr= currptr->next; }// while if(prevptr==NULL){ newptr->next=headptr; headptr==newptr;} else{ newptr->next=currptr; prevptr->next=newptr; } } } void paparData(){ NODE*currptr; currptr=headptr; if(currptr==NULL) cout<<"Senarai kosong"; else{ while(currptr!=NULL){ cout<<currptr->number; currptr=currptr->next; } } }

# data[].attributes.body
#include <iostream>
#include <iomanip>

using namespace std;

struct NODE{
int number;
NODE* next;
}*headptr;
void ciptasenaraikosong();
void insertData();
int main(){
ciptasenaraikosong();
insertData();
}
void ciptasenaraikosong(){
headptr=NULL;
}
void insertData()}
NODE*newptr;
int nilai;
cout<<"masukkan data";
cin>>nilai;
newptr=new NODE;
newptr->number=nilai;
newptr->next=NULL;
if(headptr==NULL)
headptr==newptr;
else{
prevptr=NULL;
currptr=headptr;
while(curptr!=NULL&&(newptr->number>currptr->number)){
prevptr=currptr;
currptr->currptr->next;
}//while
if(prevptr==NULL{
newptr->next=headptr;
headptr==newptr;}
else{
newptr->next=currptr;
prevptr->next=newptr;
}
}
}
void paparData(){
NODE*currptr;
currptr=headptr;
if currptr==NULL;
cout>"senarai kosong";
else{
while (currptr!=NULL)}
cout<<currptr->number;
currptr=currptr->next;
}
int main(){
ciptasenaraikosong();
insertData();
return0;
}

# data[].attributes.body
#include <iostream> using namespace std; struct NODE; int num; NODE*next; } *headptr; ciptasenaraikosong(); insertData(); insertData(): insertData(); paparData(); int main(){ } void ciptasenaraikosong(){ headptr=NULL; } void masukkan data(){ NODE*newptr; int nilai; newptr=new NODE; newptr->number=nilai; newptr->next=NULL; } else { prevptr=NULL; currptr=headptr; currptr=crrptr->next; }//while if prevptr==NULL){ newptr->Next=headptr; headptr==newptr;} else newptr->next=currptr; prevptr->next=newptr; } } } void paparData() NODE*currptr; if (currptr==NULL; cout<<"senaraikosong"; else{ while(currptr=NULL){ cout<<currptr->number; currptr=currptr->next; } } }

# data[].attributes.body
#include <iostream>
using namespace std;

struct NODE{
int number;
NODE*next;
}
*headptr

void ciptasenaraikosong();
void insertData();
void paparData();
int main ()}
ciptasenaraikosong();
insertData();
insertData();
insertData();
paparData();
}
void ciptasenaraikosong(){
headptr=NULL;
}
void insertData(){
NODE*newptr,*currptr,*prevptr;
int nilai;
cout<< "masukkan data";
cin>> nilai;
newptr = new NODE;
Newptr->number=nilai;
newptr->next=NULL;
if(headptr == NULL)
headptr == newptr;
else {
prevptr = NULL;
currptr = headptr;
while(currptr!=NULL&&(newptr->number>currptr>number)){
preptr = currptr}
currptr = currptr->next;
}// while
if (preptr == NULL){
Newptr->next=headptr;
headptr == newptr;}
else{
currptr->next=newptr;
currptr=newptr;
}
}
}
void papadData(){
NODE*currptr;
currptr=headptr;
if (currptr == NULL)
cout<<"senaraikosong":
else{
while(currptr!=NULL){
cout<<currptr->number;
currptr=currptr->next;
}
}
}

# data[].attributes.body
#include <iostream.h> using namespace std; void CiptaSenaraiKosong(); void InsertData(); void PaparData(); struct NODE{ int number; NODE*next; }; NODE*headptr; int main(){ CiptaSenaraiKosong(); InsertData(); InsertData(); InsertData(); PaparData(); } void CiptaSenaraiKosong(){ headptr = NULL; } void InsertData(){ NODE*newptr, *currptr,*preptr; int nilai; cout<< "masukkan data"; cin>> nilai; newptr = new NODE(); newptr -> number = nilai; newptr -> next = NULL; cout << newptr -> number; if (headptr == NULL) headptr == newptr; else{ preptr = NULL; currptr = headptr; while((currptr!=NULL) && (newptr->number >currptr->number)){ preptr = currptr; cout << currptr ->number; currptr = currptr ->next; }// while if( preptr==NULL){ newptr -> next = headptr; headptr == newptr;} else{ newptr -> next = currptr; preptr -> next = newptr; } } } void paparData(){ NODE * currptr; currptr= headptr; if (currptr== NULL) cout << "Senarai kosong"; else{ while(currptr!= NULL){ cout << currptr -> number; currptr = currptr -> next; } } }

# data[].attributes.body
#include<iostream> using namespace std; struct NODE{ int number; NODE *next; }* headptr; void ciptasenaraikosong(); void insertData(); void paparData(); int main(){ ciptasenaraikosong(); insertData(); paparData(); } void ciptasenaraikosong(){ headptr = NULL; } void insertData(){ NODE * newptr, *currptr, *prevptr; int nilai; cout<<" Masukkan data"; cin>>nilai; newptr = new NODE(); newptr->number = nilai; newptr->next= NULL; cout<<newptr->number; if(headptr==NULL) headptr== newptr; else{ prevptr = NULL; currptr = headptr; while((currptr!=NULL) && (newptr->number > currptr->number)){ prevptr= currptr; cout<<currptr->number; currptr= currptr->next; }// while if( prevptr==NULL){ newptr->next = headptr; headptr== newptr;} else{ newptr->next = currptr; prevptr->next = newptr; } } } void paparData(){ NODE * currptr; currptr= headptr; if (currptr== NULL) cout<< "Senarai kosong"; else{ while(currptr!=NULL){ cout<< currptr->number; currptr= currptr->next; } } }

# data[].attributes.body
#include <iostream>
using namespace std;

struct NODE {

int number;
NODE*next;
}*headptr;

void ciptasenaraikosong();
void insertData();
void paparData();

int main(){

ciptasenaraikosong();
insertData();
paparData();

}void ciptasenaraikosong(){
headptr=NULL;

}
void insertData(){
NODE*newptr,*currptr,*prvptr;

int nilai;

cout<<"enter the data"

cin>>nilai;

newptr=new NODE;

newptr->number=nilai;

newptr->next=NULL;

if(headptr==NULL)

headptr==newptr;

else{

prevptr = NULL;

currptr = headptr;

while(currptr!=NULL && (newptr->number >currptr->number)){}

prevptr= currptr;

cout<<currptr->number;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

# data[].attributes.body
#include<iostream.h> using namespace std; struct NODE{ int number; NODE *next; }* headptr; void ciptasenaraikosong(); void insertData(); void paparData(); int main(){ ciptasenaraikosong(); insertData(); insertData(); insertData(); paparData(); } void ciptasenaraikosong(){ headptr = NULL; } void insertData(){ NODE * newptr, *currptr, *prevptr; int nilai; cout<<" Masukkan data : "; cin>>nilai; newptr = new NODE; newptr->number = nilai; newptr->next= NULL; if(headptr==NULL) headptr== newptr; else{ prevptr = NULL; currptr = headptr; while(currptr!=NULL && (newptr->number<currptr->number)){ prevptr= currptr; currptr= currptr->next; }// while if( prevptr==NULL){ newptr->next = headptr; headptr== newptr;} else{ newptr->next = currptr; prevptr->next = newptr; } } } void paparData(){ NODE * currptr; currptr= headptr; if (currptr== NULL) cout<< "Senarai kosong"; else{ while(currptr!=NULL){ cout<< currptr->number; currptr=currptr->next; } } }

# data[].attributes.body
#include <iostream> using namespace std; struct NODE { int number; NODE*next; }*headptr;

void CiptaSenaraiKosong () { headptr=NULL; }

void insertData() { NODE * newptr; int nilai; cout<<" Masukkan data"; cin>>nilai; newptr=new NODE; newptr->number = nilai; newptr->next= NULL; if(headptr==NULL) headptr== newptr; }

# data[].attributes.body
#include <iostream>

using namesapce std;

struct NODE {

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong;

void insert Data();

int main()

}

ciptasenaraikosong();

InsertData();

}

{NODE*nemwptr;

int nilai

cout<<"masukkan data";

cin>>nilai;

newptr = new NODE;

new

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE *next;

}* headptr;

void ciptasenaraikosong();

void insertData();

void paparData()

int main(){

ciptasenaraikosong();

insertData();

insertData();

insertData();

paparData()

} void ciptasenaraikosong(){

headptr = NULL;

}

void insertData(){

NODE * newptr, *currptr, *prevptr;

int nilai;

cout<<"Sila Masukkan data";

cin>>nilai;

newptr = new NODE;

newptr->number = nilai;

newptr->next= NULL;

if(headptr==NULL)

headptr==newptr;

else {

prevptr=NULL;

currptr=headptr;

while(currptr=NULL&&(newptr-number>currptr-number)){

prevptr=currptr;

currptr=currptr->next;

}//while

if prevptr==NULL){

newptr->Next=headptr;

headptr==newptr;}

else {

newptr->next = currptr;

prevptr->next = newptr;

}

}

}

void paparData(){

NODE * currptr;

currptr= headptr;

if (currptr== NULL)

cout<< "Senarai kosong";

else{

while(currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include <iostream> using namespace std; struct NODE ; int number ; NODE * next ; *headptr ; void CiptaSenaraiKosong (); int main() { void CiptaSenaraiKosong () headptr = NULL; }

void insertData () {

NODE * newptr ;

int nilai;

cout<<"Sila masukkan data"";

cin>>nilai;

newptr = new NODE;

newptr->number = nilai;

newptr->next = NULL;

}

if(headptr==NULL)

headptr== newptr;

else{

prevptr=NULL;

currptr=headptr;

while(currptr!=NULL&&(newptr->number>currptr->number)){

prevptr=currptr->next;

}//while

if(preptr==NULL){

newptr->next=headptr;

headptr==newptr;}

else{

newptr->next=currptr;

prevptr->next=newptr;

}

}

}

void paparData() {

NODE * currptr;

currptr=headptr;

if (currptr==NULL)

cout<<"Senarai Kosong";

else {

while (currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include <stream>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void cipta senarai kosong();

void insert data();

int main(){

cipta senarai kosong();

}

void cipta senarai kosong(){

headptr=NULL;

}

void insert data(){

NODE*newptr;

int nilai;

cout<<"masukikan data";

cin>>nilai;

newptr

# data[].attributes.body
#include<iostream.h> struct NODE{ int number; NODE *next; }* headptr; void ciptasenaraikosong(); void insertData(); int main(){ ciptasenaraikosong(); insertData(); } void ciptasenaraikosong(){ headptr = NULL; } void insertData(){ NODE * newptr; int nilai; cout<<"Masukkan data"; cin>>nilai; newptr = new NODE; newptr->number = nilai; newptr->next= NULL; }

# data[].attributes.body
#include<iostream> using namespace std; struct NODE{ int number; NODE*next; }*headptr; void ciptasenaraikosong(); void insertData(); int main(){ ciptasenaraikosong(); insertData(); } void ciptasenaraikosong(){ headptr = NULL; } void insertData(){ NODE*newptr; int nilai; cout<<"Masukkan data"; cin>>nilai; newptr = new NODE; newptr->number =nilai; newptr->next =NULL; }

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE *next;

}* headptr;

void ciptasenaraikosong();

void insertData();

int main(){

ciptasenaraikosong();

insertData();

insertData();

} void ciptasenaraikosong(){

headptr = NULL;

}

void insertData(){

NODE * newptr, *currptr, *prevptr;

int nilai;

cout<<" Masukkan data";

cin>>nilai;

newptr = new NODE;

newptr->number = nilai;

newptr->next= NULL;

if(headptr==NULL)

headptr== newptr;

else{

prevptr = NULL;

currptr = headptr;

while(currptr!=NULL && (newptr->number >currptr->number)){

prevptr= currptr;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

}

void paparData(){

NODE * currptr;

currptr= headptr;

if (currptr== NULL)

cout<< "Senarai kosong";

else{

while()

while(currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include<iostream>

using namespacestd;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertData();

int main(){

ciptasenaraikosong();

InsertData();

}

{NODE*newptr;

int nilai;

cout>>"masukkan data";

cin>>nilai;

}

# data[].attributes.body
#include <iostream>
using namespace std;

struct NODE{
int number;
NODE*next;
}
*headptr
void ciptasenaraikosong();
int main ()
void ciptasenaraikosong();
headptr = NULL;

# data[].attributes.body
#include <iostream> #include <string> using namespace std; int main() struct NODE; int number; NODE* next; } *headptr; void ciptasenaraikosong(){ headptr=null;} void main()} ciptasenaraikosong();

headptr=NULL;

}

void inserData(){

NODE * newptr;

int nilai;

cout<<"" Masukkan data"";

cin>>nilai;

newptr = new NODE;

}

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

int main(){

ciptasenaraikosong();

}

void ciptasenaraikosong;

}

void ciptasenaraikosong(){

headptr=null;

}

# data[].attributes.body
#include <iostream> using namespace std; struct NODE { int number; NODE*next; }*headptr; void ciptaSenaraiKosong(); int main(){ ciptaSenaraiKosong(); }void ciptaSenaraiKosong(){ headptr = NULL; }

# data[].attributes.body
#include <iostream>

using namespace std;

struct NODE {

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertData();

int main()

{

ciptasenaraikosong();

InsertData();

}

{NODE*newptr;

int nilai;

cout<<"masukkan data";

cin>>nilai;

}

else

{

prevptr=NULL;

curptr=headptr;

while ((curptr1=NULL)&&(nilai>curptr>number))

{

preptr=curptr>next;

}

if (preptr==NULL)

{

newptr>next=headptr;

headptr=newptr;

}

else

curptr>next=newptr;

curptrnewptr;

# data[].attributes.body
#include<iostream>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertdata

# data[].attributes.body
#include <iostream> using namespace std; struct NODE { int number; NODE*next; }*headptr; void ciptaSenaraiKosong(); int main(){ ciptaSenaraiKosong(); } void ciptasenaraikosong(){ headptr=NULL; }

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE *next;

} *headptr;

void ciptasenaraikosong();

void insertData();

void paparData();

int main(){

ciptasenaraikosong();

insertData();

insertData();

insertData();

insertData();

paparData();

}

void ciptasenaraikosong(){

headptr=NULL;

}

void insertData(){

NODE*newptr,*curptr,*preptr;

int nilai;

cout<<"masukkan Data";

cin>>nilai;

newptr=new NODE;

newptr->number=nilai;

newptr->next=NULL;

if(headptr==NULL){

headptr=newPtr;

}

else

{

prevptr=NULL;

curptr=headPtr;

while ((curptr1=NULL)&& (nilai>curptr->number))

{

preptr=curptr;

curptr=curptr->next;

}

if(preptr==NULL)

{

newptr->next=headptr;

headptr=newptr;

}

else

{

curptr->next=newptr;

curptrnewptr;

}

}

}

void paparData(){

Node*curptr;

curptr=headptr;

if(curptr==NULL)

cout<<"Senarai Kosong";

else{ while(curptr!=NULL){

cout<<curptr->number;

curptr=curptr->next;

}

int main () {

ciptasenaraikosong();

insertData();

return0;

}

# data[].attributes.body
#include <iostream>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertDATA();

int main (){

ciptasenaraikosong();

insertDATA();

insertDATA();

}

void ciptasenaraikosong(){

headptr=NULL;

}

void insertDATA(){

NODE*newptr,*currptr,*prevptr;

int nilai;

cout<<"Masukkan DATA";

cin>> nilai;

newptr=new NODE;

newptr->number=nilai;

newptr->next=NULL;

if (headptr==NULL)

headptr==newptr;

else { prevptr=NULL;

currptr=headptr;

while (currptr!=NULL &&(newptr->number>currptr->number)){

prevptr=currptr;

currptr=currptr->next;

}//while

if(prevptr==NULL)

{

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

currptr->next = newptr;

currptr= newptr;

}

}

}

void paparData(){

NODE * currptr;

currptr= headptr;

if (currptr== NULL)

cout<< "Senarai kosong";

else{

while(currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include<iostream.h>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertData();

int main(){

ciptasenaraikosong();

insertData();

}

void ciptasenaraikosong(){

headptr=NULL;

}

void insertData(){

NODE*newptr;

int nilai;

cout<<"masukkan data";

cin>>nilai;

newptr=new NODE;

newptr->number=nilai;

newptr->next=NULL;

if(headptr==NULL)

headptr==newptr;

else{

prevptr=NULL;

currptr=headptr;

while((currptr!=NULL) && (newptr->number >currptr->number)){

prevptr= currptr;

cout<<currptr->number;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

currptr->next = newptr;

currptr= newptr;

}

}

}

void paparData(){

NODE * currptr;

currptr= headptr;

if (currptr== NULL)

cout<< "Senarai kosong";

else{

while(currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

int main(){

ciptasenaraikosong();

}

void ciptasenaraikosong;

}

void ciptasenaraikosong(){

headptr=null;

}

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE *next;

}* headptr;

void ciptasenaraikosong();

void insertData();

int main(){

ciptasenaraikosong();

insertData();

} void ciptasenaraikosong(){

headptr = NULL;

}

void insertData(){

NODE * newptr;

int nilai;

cout<<" Masukkan data";

cin>>nilai;

newptr = new NODE;

newptr->number = nilai;

newptr->next= NULL;

if(headptr==NULL)

headptr== newptr;

else{

prevptr=NULL;

currptr=headptr;

while(currptr!=NULL&&(newptr->number>currptr->number)){

prevptr=currptr->next;

}//while

if(preptr==NULL){

newptr->next=headptr;

headptr==newptr;}

else{

newptr->next=currptr;

prevptr->next=newptr;

}

}

}

# data[].attributes.body
#nclude <iostream.h> using namespace std; struct NODE { int number; NODE*next; } *headterptr; void CiptaSenaraiKosong () ; { int main () { void CiptaSenaraiKosong () { headptr = NULL int main ()

CiptaSenaraiKosong (); insertData ();

}

void insertdata(){

NODE*"newptr;

int nilai;

cout << "masukkan data";

cin>> "nilai"

newptr = newNODE; }

# data[].attributes.body
#include<iostream>

using namespace std;

struct NODE{

int number;

NODE *next;

}* headptr;

void ciptasenaraikosong();

void insertData();

void paparData();

int main(){

ciptasenaraikosong();

insertData();

insertData();

insertData();

paparData();

} void ciptasenaraikosong(){

headptr = NULL;

}

void insertData(){

NODE * newptr, *currptr, *prevptr;

int nilai;

cout<<" Masukkan data";

cin>>nilai;

newptr = new NODE;

newptr->number = nilai;

newptr->next= NULL;

if(headptr==NULL)

headptr== newptr;

else{

prevptr = NULL;

currptr = headptr;

while(currptr!=NULL && (newptr->number >currptr->number)){

prevptr= currptr;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

}

void paparData(){

}

# data[].attributes.body
#include<stream>

using namespace std;

struct NODE{

int number;

NODE *next;

}* headptr;

void ciptasenaraikosong();

void insertData();

void paparData();

int main(){

ciptasenaraikosong();

insertData();

insertData();

paparData();

} void ciptasenaraikosong(){

headptr = NULL;

}

void insertData(){

NODE * newptr, *currptr, *prevptr;

int nilai;

cout<<" Masukkan data";

cin>>nilai;

newptr = new NODE();

newptr->number = nilai;

newptr->next= NULL;

cout<<newptr->number;

if (headptr==NULL)

headptr== newptr;

else{

prevptr = NULL;

currptr = headptr;

while((newptr->number > currptr->number)) {

prevptr= currptr;

currptr= currptr->next;

}// while

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;

}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

}

void paparData(){

NODE * currptr;

currptr= headptr;

if (headptr== NULL)

cout<< "Senarai kosong";

else{

while(currptr!=NULL){

cout<< currptr->number;

currptr= currptr->next;

}

}

}

# data[].attributes.body
#include<iostream.h>

using namespace std;

struct NODE{

int number;

NODE*next;

}*headptr;

void ciptasenaraikosong();

void insertData();

void paparData();

int main() {

ciptasenaraikosong();

insertData();

insertData();

insertData();

paparData();

}

void ciptasenaraikosong(){

headptr=NULL;

}

void insertData(); {

NODE*newptr,currptr,prevptr;

int nilai;

cout<<"Masukkan Data : ";

cin>>nilai;

newptr = newNODE;

newptr->number=nilai;

newptr->next=NULL;

if(headptr==NULL)

headptr==newptr;

else {

prevptr*NULL;

currptr=headptr;

while(currptr!=NULL && (newptr->number >currptr->number)) {

prevptr=currptr;

currptr=currptr->next;

}

if( prevptr==NULL){

newptr->next = headptr;

headptr== newptr;}

else{

newptr->next = currptr;

prevptr->next = newptr;

}

}

}

void paparData(){

NODE*currptr;

currptr=headptr;

if (currptr=NULL)

cout<<"Senarai Kosong !";

else {

while(currptr!=NULL){

cout<<currptr->number;

currptr=currptr->next;

}

}

}