Question: What will do the following method?public void dosomething ( int x ) { if ( top = = - 1 ) { system . out.print.In
What will do the following method?public void dosomething int xif top systemout.print.InStack is empty";return;x times top ;for int i ; i rotations; iint temp arr ;for int j ; j top; j#arrj arrj ;arr top temp; A Rotate the stack elements in the left direction. B Remove duplicates from a given stack.O C Reverse the elements of a stack.O D Rotate the stack elements to the right direction.Clear my choice
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
