12th Class Computers Science Sample Paper Data Structure - Sample Paper-2

  • question_answer
    Consider a Queue with front=0, rear=3 and size=5 Diksha, Reena, Bhawna, Teena What will be the value of front and rear when "Teena" is deleted from the queue.

    A) f=0, r=2   

    B) f=1, r=2

    C) f=1, r=3       

    D) None of the above

    Correct Answer: A

    Solution :

    [a] f=0. r=2
    We are given the value of rear as 3 and front is 0 and the element "Teena" is being deleted from position 0. But after deleting an element the next element i.e. 1 becomes front (0) and accordingly rear become size-1 i.e. 2.
     


You need to login to perform this action.
You will be redirected in 3 sec spinner