MY CODE IS GIVING NULL POINTER EXCEPTION PLS TELL ME MISTAKE I AM ALSO ATTACHING LINK TO THE CODE

please share the saved code

here is the link to the code-- https://www.online-ide.com/kAYCqfoONM

You are getting null pointer exception because you are trying to access data of curr which might be null in this case, hence error. So, Instead check if the queue is empty or not.see this: