showing incorrect output
Not printing front element
see in the main( ) last line
Hello @amit0001 please share your code by saving it on ide.codingblocks.com .
i will check your code:
Hello @amit0001 you are little confused here:
this is happening becuase you are taking mod here with ms in pop function and during that when all the elements are popped then after that front will go to zero because of mod.
as we are not deleting the elements from the array we are just hypothetically handeling the elements in the array by manipulating front. so by giving the front value in the range of ms it will give us values.
when you doing pop you are just incrementing the front which will then be used as indexing in the array and then print the next element.
hope this explains you.
if you still have any doubt you can ask here;
Happy Learning!!
got it !
…