आज मैं आपको इस पोस्ट में Queue Implementation with Link List in data structure के बारें में बताऊंगा, और इसके example को भी पढेंगे, तो चलिए शुरू करते हैं:-
Queue Implementation with Link List
Algorithm for Insertion
Struct_Queue NEW PTR, *temp [Declare variable type struct_queue]
temp=start [Initialize temp]
NEW = new node [Allocate memory for new element]
NEW-no = value [Insert value into the data filed of Element];
NEWPTR-> NEXT=NULL
If (Rear = = NULL) [Queue is empty, and element to be Entered is first element]
Set Front = NEW PTR
Set Rear = NEW PTR
else :
while (tempm-next = NULL)
tem=temp®next
Temp = temp-NEWPTR
End.
Algorithm for Deletion
- if(front = = NULL)
write Queue is empty and exit
else
temp = start
value = temp®no
Start = Start-next
free(temp) [End else]
return(value) [End if]
- Exit.
निवेदन:- अगर आपके लिए यह आर्टिकल useful रहा हो तो इसे अपने दोस्तों और classmates के साथ अवश्य share कीजिये, या अन्य विषयों से related कोई question हो तो नीचे कमेंट के द्वारा बताइए. thanks.