SlideShare a Scribd company logo
1 of 6
Download to read offline
Discuss about Header Node? And also write a program for unordered single linked list and
linked implementation of QUEUE?
Solution
Header node:
Sometimes it is desire to keep an extra node at the front of a List. Such a node doesn’t represent
an item in the List and is called a Header Node or a List Header. The Information field of such
Header node might be unused but the Next field maintains the first node address. More often the
information of such a node could be used to keep Global Information about the Entire List.
One of the applications of Header node is the information portion of the Header node contains
the number of nodes (not including Header) in the List. In this Structure the Header must be
adjusted the total number of nodes when we apply addition or deletion operation on the List. We
can directly obtained the total number of nodes without traversing the entire List.
By using this application, we can develop Data Structure Stack easily. Since Header node
information field maintains the number of elements that the Stack contains.
Another application is we can simply develop the Data Structure Queue. Until now, two external
pointers, Front & Rear, were necessary for a List to represent a Queue. However, now only a
single external pointer is sufficient to maintain a Queue that is Head node. Because the Header
node next field behave like a Front and information field of Header node maintains last node
address so that it is behave like a Rear .
Another possibility for the use of the information portion of a List Header is as a pointer
to a Curr node in the List during a traversal process. This would be eliminate the node for an
external pointer during traversal.
#include
#include
#include
#include
struct node
{
char info;
struct node *next;
};
typedef struct node sl;
void display(sl *);
sl * create(sl *root)
{
sl *curr,*new;
char val;
printf(" Enter $ to STOP --- Otherwise Continue : ");
fflush(stdin);
scanf("%c",&val);
while(val != '$')
{
new=(sl *) malloc(sizeof(sl));
new->info = val;
new->next = NULL;
if(root == NULL)
root = new;
else
{
curr = root;
while( curr->next != NULL )
curr = curr->next;
curr->next = new;
}
printf(" Enter $ to STOP --- Otherwise Continue : ");
fflush(stdin);
scanf("%c",&val);
}
printf(" The Created Linked List Is  ");
display(root);
return root;
}
sl * delete(sl *root,char val)
{
sl *temp,*curr,*rear;
curr = root;
rear = NULL;
while( curr != NULL && val != curr->info )
{
rear = curr;
curr = curr->next;
}
if(curr == NULL)
{
if( rear == NULL)
{
printf(" Linked List is Empty");
printf(" Deletion is not Possible ");
}
else
{
printf(" deleted Node does not exist in List");
printf(" Deletion is not Possible ");
}
}
else
{
if( rear == NULL)
{
temp = root;
root = root->next;
}
else
{
temp = curr;
rear->next = curr->next;
}
printf(" Node is deleted ");
printf(" Deleted Node information is %c",temp->info);
free(temp);
}
display(root);
return root;
}
sl * insert(sl *root,char val)
{
sl *curr,*new;
new=(sl *) malloc(sizeof(sl));
new->info = val;
new->next = NULL;
if(root == NULL)
root = new;
else
{
curr = root;
while( curr->next != NULL )
curr = curr->next;
curr->next = new;
}
return root;
}
void display(sl *start)
{
printf(" ROOT-> ");
while(start != NULL )
{
printf("%c -> ",start->info);
start =start->next;
}
printf("NULL  ");
getch();
}
char menu()
{
char ch;
clrscr();
gotoxy(33,2); printf("MAIN MENU");
gotoxy(25,6); printf("Creation C");
gotoxy(25,8); printf("Insertion I");
gotoxy(25,10);printf("Removing R");
gotoxy(25,12);printf("Display D");
gotoxy(25,14);printf("Quit Q");
gotoxy(10,30);printf(" Enter Choice : ");
fflush(stdin);
scanf("%c",&ch);
return(ch);
}
main()
{
sl *insert(sl *,char),*delete(sl *,char),*create(sl *);
sl *root=NULL;
char item;
char choice;
char menu();
while( ( choice=menu() ) != 'Q' || ( choice != 'q') )
{
switch(choice)
{
case 'c':
case 'C': root = NULL;
root = create(root);
break;
case 'i':
case 'I': printf("Enter Character Item to be Inserted : ");
fflush(stdin);
scanf("%c",&item);
root = insert(root,item);
break;
case 'd':
case 'D': printf("The Current Linked List is : ");
display(root);
getch();
break;
case 'r':
case 'R': printf("Enter the Item wich you want to be Remove :");
fflush(stdin);
scanf("%c",&item);
root = delete(root,item);
break;
case 'q':
case 'Q': return;
}
}
}

More Related Content

Similar to Discuss about Header Node And also write a program for unordered si.pdf

Use the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfUse the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfsales87
 
File name a2.cppTaskFor this assignment, you are required to ei.pdf
File name a2.cppTaskFor this assignment, you are required to ei.pdfFile name a2.cppTaskFor this assignment, you are required to ei.pdf
File name a2.cppTaskFor this assignment, you are required to ei.pdfinfomalad
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfeyewaregallery
 
Unit ii(dsc++)
Unit ii(dsc++)Unit ii(dsc++)
Unit ii(dsc++)Durga Devi
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Balwant Gorad
 
How to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdfHow to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdffootstatus
 
Program In C You are required to write an interactive C program that.pdf
Program In C You are required to write an interactive C program that.pdfProgram In C You are required to write an interactive C program that.pdf
Program In C You are required to write an interactive C program that.pdfamitbagga0808
 
coding in C- Create a function called reverseList that takes the head.docx
coding in C- Create a function called reverseList that takes the head.docxcoding in C- Create a function called reverseList that takes the head.docx
coding in C- Create a function called reverseList that takes the head.docxtienlivick
 
pleaase I want manual solution forData Structures and Algorithm An.pdf
pleaase I want manual solution forData Structures and Algorithm An.pdfpleaase I want manual solution forData Structures and Algorithm An.pdf
pleaase I want manual solution forData Structures and Algorithm An.pdfwasemanivytreenrco51
 
lect- 3&4.ppt
lect- 3&4.pptlect- 3&4.ppt
lect- 3&4.pptmrizwan38
 

Similar to Discuss about Header Node And also write a program for unordered si.pdf (20)

Use the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdfUse the singly linked list class introduced in the lab to implement .pdf
Use the singly linked list class introduced in the lab to implement .pdf
 
File name a2.cppTaskFor this assignment, you are required to ei.pdf
File name a2.cppTaskFor this assignment, you are required to ei.pdfFile name a2.cppTaskFor this assignment, you are required to ei.pdf
File name a2.cppTaskFor this assignment, you are required to ei.pdf
 
Linked list1.ppt
Linked list1.pptLinked list1.ppt
Linked list1.ppt
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
 
Data structure
 Data structure Data structure
Data structure
 
linkedlist.pptx
linkedlist.pptxlinkedlist.pptx
linkedlist.pptx
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
 
Adt of lists
Adt of listsAdt of lists
Adt of lists
 
Unit - 2.pdf
Unit - 2.pdfUnit - 2.pdf
Unit - 2.pdf
 
Unit ii(dsc++)
Unit ii(dsc++)Unit ii(dsc++)
Unit ii(dsc++)
 
DS Unit 2.ppt
DS Unit 2.pptDS Unit 2.ppt
DS Unit 2.ppt
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
 
How to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdfHow to delete one specific node in linked list in CThanksSolu.pdf
How to delete one specific node in linked list in CThanksSolu.pdf
 
Program In C You are required to write an interactive C program that.pdf
Program In C You are required to write an interactive C program that.pdfProgram In C You are required to write an interactive C program that.pdf
Program In C You are required to write an interactive C program that.pdf
 
Linked list
Linked listLinked list
Linked list
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
 
coding in C- Create a function called reverseList that takes the head.docx
coding in C- Create a function called reverseList that takes the head.docxcoding in C- Create a function called reverseList that takes the head.docx
coding in C- Create a function called reverseList that takes the head.docx
 
pleaase I want manual solution forData Structures and Algorithm An.pdf
pleaase I want manual solution forData Structures and Algorithm An.pdfpleaase I want manual solution forData Structures and Algorithm An.pdf
pleaase I want manual solution forData Structures and Algorithm An.pdf
 
Data Structure
Data StructureData Structure
Data Structure
 
lect- 3&4.ppt
lect- 3&4.pptlect- 3&4.ppt
lect- 3&4.ppt
 

More from eyevision3

According to Bacon, the objets of scientific inquiry were a phenomen.pdf
According to Bacon, the objets of scientific inquiry were a phenomen.pdfAccording to Bacon, the objets of scientific inquiry were a phenomen.pdf
According to Bacon, the objets of scientific inquiry were a phenomen.pdfeyevision3
 
A--The new generation of robotics    a) Considering that the new g.pdf
A--The new generation of robotics    a) Considering that the new g.pdfA--The new generation of robotics    a) Considering that the new g.pdf
A--The new generation of robotics    a) Considering that the new g.pdfeyevision3
 
a).write the differences between Bryophytes and pterophytes (ferns)..pdf
a).write the differences between Bryophytes and pterophytes (ferns)..pdfa).write the differences between Bryophytes and pterophytes (ferns)..pdf
a).write the differences between Bryophytes and pterophytes (ferns)..pdfeyevision3
 
Which best describes the following A symbol, word, name, sound, or .pdf
Which best describes the following A symbol, word, name, sound, or .pdfWhich best describes the following A symbol, word, name, sound, or .pdf
Which best describes the following A symbol, word, name, sound, or .pdfeyevision3
 
What are the types of diffusion and describe the two atomic mechanism.pdf
What are the types of diffusion and describe the two atomic mechanism.pdfWhat are the types of diffusion and describe the two atomic mechanism.pdf
What are the types of diffusion and describe the two atomic mechanism.pdfeyevision3
 
3. Four species of ground beetle in the genus Carabus are known to be.pdf
3. Four species of ground beetle in the genus Carabus are known to be.pdf3. Four species of ground beetle in the genus Carabus are known to be.pdf
3. Four species of ground beetle in the genus Carabus are known to be.pdfeyevision3
 
Network service providers retain records for various lengths of time.pdf
Network service providers retain records for various lengths of time.pdfNetwork service providers retain records for various lengths of time.pdf
Network service providers retain records for various lengths of time.pdfeyevision3
 
Please use your own words, do not just copy and paste !!!For Selec.pdf
Please use your own words, do not just copy and paste !!!For Selec.pdfPlease use your own words, do not just copy and paste !!!For Selec.pdf
Please use your own words, do not just copy and paste !!!For Selec.pdfeyevision3
 
My sister, Lilly, and I used to have a great time playing with jelly.pdf
My sister, Lilly, and I used to have a great time playing with jelly.pdfMy sister, Lilly, and I used to have a great time playing with jelly.pdf
My sister, Lilly, and I used to have a great time playing with jelly.pdfeyevision3
 
4. Why are women more prone to urinary tract infectionsSolution.pdf
4. Why are women more prone to urinary tract infectionsSolution.pdf4. Why are women more prone to urinary tract infectionsSolution.pdf
4. Why are women more prone to urinary tract infectionsSolution.pdfeyevision3
 
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdfeyevision3
 
Sort animals below into subsets. There are five. State reason for.pdf
Sort animals below into subsets. There are five. State reason for.pdfSort animals below into subsets. There are five. State reason for.pdf
Sort animals below into subsets. There are five. State reason for.pdfeyevision3
 
Protons are unable to cross the lipid bilayer becausea) the lipid.pdf
Protons are unable to cross the lipid bilayer becausea) the lipid.pdfProtons are unable to cross the lipid bilayer becausea) the lipid.pdf
Protons are unable to cross the lipid bilayer becausea) the lipid.pdfeyevision3
 
More practice with four coins Make a neat table that lists all the s.pdf
More practice with four coins  Make a neat table that lists all the s.pdfMore practice with four coins  Make a neat table that lists all the s.pdf
More practice with four coins Make a neat table that lists all the s.pdfeyevision3
 
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdf
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdfQuestion 10 (1.2 points) d What helps explain the popularity of mutua.pdf
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdfeyevision3
 
overall, what is the net trend of NPP due to climate change Moving t.pdf
overall, what is the net trend of NPP due to climate change Moving t.pdfoverall, what is the net trend of NPP due to climate change Moving t.pdf
overall, what is the net trend of NPP due to climate change Moving t.pdfeyevision3
 
1. Substance’s Effect Increases the number of free hydrogen ions or.pdf
1. Substance’s Effect Increases the number of free hydrogen ions or.pdf1. Substance’s Effect Increases the number of free hydrogen ions or.pdf
1. Substance’s Effect Increases the number of free hydrogen ions or.pdfeyevision3
 
1. What are three functions of an operating system2. What are t.pdf
1. What are three functions of an operating system2. What are t.pdf1. What are three functions of an operating system2. What are t.pdf
1. What are three functions of an operating system2. What are t.pdfeyevision3
 
Most bacteria that cause diseases in humans have a temperature optim.pdf
Most bacteria that cause diseases in humans have a temperature optim.pdfMost bacteria that cause diseases in humans have a temperature optim.pdf
Most bacteria that cause diseases in humans have a temperature optim.pdfeyevision3
 
Need help understanding how to solve D. and E. Please show how y.pdf
Need help understanding how to solve D. and E. Please show how y.pdfNeed help understanding how to solve D. and E. Please show how y.pdf
Need help understanding how to solve D. and E. Please show how y.pdfeyevision3
 

More from eyevision3 (20)

According to Bacon, the objets of scientific inquiry were a phenomen.pdf
According to Bacon, the objets of scientific inquiry were a phenomen.pdfAccording to Bacon, the objets of scientific inquiry were a phenomen.pdf
According to Bacon, the objets of scientific inquiry were a phenomen.pdf
 
A--The new generation of robotics    a) Considering that the new g.pdf
A--The new generation of robotics    a) Considering that the new g.pdfA--The new generation of robotics    a) Considering that the new g.pdf
A--The new generation of robotics    a) Considering that the new g.pdf
 
a).write the differences between Bryophytes and pterophytes (ferns)..pdf
a).write the differences between Bryophytes and pterophytes (ferns)..pdfa).write the differences between Bryophytes and pterophytes (ferns)..pdf
a).write the differences between Bryophytes and pterophytes (ferns)..pdf
 
Which best describes the following A symbol, word, name, sound, or .pdf
Which best describes the following A symbol, word, name, sound, or .pdfWhich best describes the following A symbol, word, name, sound, or .pdf
Which best describes the following A symbol, word, name, sound, or .pdf
 
What are the types of diffusion and describe the two atomic mechanism.pdf
What are the types of diffusion and describe the two atomic mechanism.pdfWhat are the types of diffusion and describe the two atomic mechanism.pdf
What are the types of diffusion and describe the two atomic mechanism.pdf
 
3. Four species of ground beetle in the genus Carabus are known to be.pdf
3. Four species of ground beetle in the genus Carabus are known to be.pdf3. Four species of ground beetle in the genus Carabus are known to be.pdf
3. Four species of ground beetle in the genus Carabus are known to be.pdf
 
Network service providers retain records for various lengths of time.pdf
Network service providers retain records for various lengths of time.pdfNetwork service providers retain records for various lengths of time.pdf
Network service providers retain records for various lengths of time.pdf
 
Please use your own words, do not just copy and paste !!!For Selec.pdf
Please use your own words, do not just copy and paste !!!For Selec.pdfPlease use your own words, do not just copy and paste !!!For Selec.pdf
Please use your own words, do not just copy and paste !!!For Selec.pdf
 
My sister, Lilly, and I used to have a great time playing with jelly.pdf
My sister, Lilly, and I used to have a great time playing with jelly.pdfMy sister, Lilly, and I used to have a great time playing with jelly.pdf
My sister, Lilly, and I used to have a great time playing with jelly.pdf
 
4. Why are women more prone to urinary tract infectionsSolution.pdf
4. Why are women more prone to urinary tract infectionsSolution.pdf4. Why are women more prone to urinary tract infectionsSolution.pdf
4. Why are women more prone to urinary tract infectionsSolution.pdf
 
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf
13 What type of joint is present at ll, the Hinge Ball and Sliding Fi.pdf
 
Sort animals below into subsets. There are five. State reason for.pdf
Sort animals below into subsets. There are five. State reason for.pdfSort animals below into subsets. There are five. State reason for.pdf
Sort animals below into subsets. There are five. State reason for.pdf
 
Protons are unable to cross the lipid bilayer becausea) the lipid.pdf
Protons are unable to cross the lipid bilayer becausea) the lipid.pdfProtons are unable to cross the lipid bilayer becausea) the lipid.pdf
Protons are unable to cross the lipid bilayer becausea) the lipid.pdf
 
More practice with four coins Make a neat table that lists all the s.pdf
More practice with four coins  Make a neat table that lists all the s.pdfMore practice with four coins  Make a neat table that lists all the s.pdf
More practice with four coins Make a neat table that lists all the s.pdf
 
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdf
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdfQuestion 10 (1.2 points) d What helps explain the popularity of mutua.pdf
Question 10 (1.2 points) d What helps explain the popularity of mutua.pdf
 
overall, what is the net trend of NPP due to climate change Moving t.pdf
overall, what is the net trend of NPP due to climate change Moving t.pdfoverall, what is the net trend of NPP due to climate change Moving t.pdf
overall, what is the net trend of NPP due to climate change Moving t.pdf
 
1. Substance’s Effect Increases the number of free hydrogen ions or.pdf
1. Substance’s Effect Increases the number of free hydrogen ions or.pdf1. Substance’s Effect Increases the number of free hydrogen ions or.pdf
1. Substance’s Effect Increases the number of free hydrogen ions or.pdf
 
1. What are three functions of an operating system2. What are t.pdf
1. What are three functions of an operating system2. What are t.pdf1. What are three functions of an operating system2. What are t.pdf
1. What are three functions of an operating system2. What are t.pdf
 
Most bacteria that cause diseases in humans have a temperature optim.pdf
Most bacteria that cause diseases in humans have a temperature optim.pdfMost bacteria that cause diseases in humans have a temperature optim.pdf
Most bacteria that cause diseases in humans have a temperature optim.pdf
 
Need help understanding how to solve D. and E. Please show how y.pdf
Need help understanding how to solve D. and E. Please show how y.pdfNeed help understanding how to solve D. and E. Please show how y.pdf
Need help understanding how to solve D. and E. Please show how y.pdf
 

Recently uploaded

Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 

Recently uploaded (20)

Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 

Discuss about Header Node And also write a program for unordered si.pdf

  • 1. Discuss about Header Node? And also write a program for unordered single linked list and linked implementation of QUEUE? Solution Header node: Sometimes it is desire to keep an extra node at the front of a List. Such a node doesn’t represent an item in the List and is called a Header Node or a List Header. The Information field of such Header node might be unused but the Next field maintains the first node address. More often the information of such a node could be used to keep Global Information about the Entire List. One of the applications of Header node is the information portion of the Header node contains the number of nodes (not including Header) in the List. In this Structure the Header must be adjusted the total number of nodes when we apply addition or deletion operation on the List. We can directly obtained the total number of nodes without traversing the entire List. By using this application, we can develop Data Structure Stack easily. Since Header node information field maintains the number of elements that the Stack contains. Another application is we can simply develop the Data Structure Queue. Until now, two external pointers, Front & Rear, were necessary for a List to represent a Queue. However, now only a single external pointer is sufficient to maintain a Queue that is Head node. Because the Header node next field behave like a Front and information field of Header node maintains last node address so that it is behave like a Rear . Another possibility for the use of the information portion of a List Header is as a pointer to a Curr node in the List during a traversal process. This would be eliminate the node for an external pointer during traversal. #include #include #include #include struct node { char info; struct node *next; }; typedef struct node sl; void display(sl *);
  • 2. sl * create(sl *root) { sl *curr,*new; char val; printf(" Enter $ to STOP --- Otherwise Continue : "); fflush(stdin); scanf("%c",&val); while(val != '$') { new=(sl *) malloc(sizeof(sl)); new->info = val; new->next = NULL; if(root == NULL) root = new; else { curr = root; while( curr->next != NULL ) curr = curr->next; curr->next = new; } printf(" Enter $ to STOP --- Otherwise Continue : "); fflush(stdin); scanf("%c",&val); } printf(" The Created Linked List Is "); display(root); return root; } sl * delete(sl *root,char val) { sl *temp,*curr,*rear; curr = root; rear = NULL; while( curr != NULL && val != curr->info ) {
  • 3. rear = curr; curr = curr->next; } if(curr == NULL) { if( rear == NULL) { printf(" Linked List is Empty"); printf(" Deletion is not Possible "); } else { printf(" deleted Node does not exist in List"); printf(" Deletion is not Possible "); } } else { if( rear == NULL) { temp = root; root = root->next; } else { temp = curr; rear->next = curr->next; } printf(" Node is deleted "); printf(" Deleted Node information is %c",temp->info); free(temp); } display(root); return root; } sl * insert(sl *root,char val)
  • 4. { sl *curr,*new; new=(sl *) malloc(sizeof(sl)); new->info = val; new->next = NULL; if(root == NULL) root = new; else { curr = root; while( curr->next != NULL ) curr = curr->next; curr->next = new; } return root; } void display(sl *start) { printf(" ROOT-> "); while(start != NULL ) { printf("%c -> ",start->info); start =start->next; } printf("NULL "); getch(); } char menu() { char ch; clrscr(); gotoxy(33,2); printf("MAIN MENU"); gotoxy(25,6); printf("Creation C"); gotoxy(25,8); printf("Insertion I"); gotoxy(25,10);printf("Removing R"); gotoxy(25,12);printf("Display D");
  • 5. gotoxy(25,14);printf("Quit Q"); gotoxy(10,30);printf(" Enter Choice : "); fflush(stdin); scanf("%c",&ch); return(ch); } main() { sl *insert(sl *,char),*delete(sl *,char),*create(sl *); sl *root=NULL; char item; char choice; char menu(); while( ( choice=menu() ) != 'Q' || ( choice != 'q') ) { switch(choice) { case 'c': case 'C': root = NULL; root = create(root); break; case 'i': case 'I': printf("Enter Character Item to be Inserted : "); fflush(stdin); scanf("%c",&item); root = insert(root,item); break; case 'd': case 'D': printf("The Current Linked List is : "); display(root); getch(); break; case 'r': case 'R': printf("Enter the Item wich you want to be Remove :"); fflush(stdin); scanf("%c",&item);
  • 6. root = delete(root,item); break; case 'q': case 'Q': return; } } }