Wrong output showing


i am referring to this code but i am getting a wrong output, please help me out

this should be tail->next

Modified Code

i am still getting all my test cases to be wrong

add one endl at end of print function so every testcase’s output comes in next line

I think this thing you can do at your own

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course