shikaruki / Hactoberfest2021

Hacktoberfest2021
43 stars 372 forks source link

new code #408

Open Anshv9616 opened 4 weeks ago

Anshv9616 commented 4 weeks ago
key changes :

Node Constructor: Simplified node creation using a constructor. Return Value on Empty Queue: Changed the return value of deQueue to -1 instead of Integer.MIN_VALUE to indicate an empty queue more clearly. Display Function: Used a do-while loop to ensure the front node is included in the output even if the queue has only one element. Clarity: Cleaned up comments and improved overall readability.