Question: please help me to complete these Question 3 (Total 16 marks): Stacks, Queues and Lists a) (3 marks). When implementing a Queue data structure, do

 please help me to complete these Question 3 (Total 16 marks):

please help me to complete these

Question 3 (Total 16 marks): Stacks, Queues and Lists a) (3 marks). When implementing a Queue data structure, do you prefer to use an array-based queue or a linked-list based queue? Is one implementation better than the other? Justify your answer. b) (10 marks). Write a program in Python or Java that inserts six funny jokes into a stack and then prompts the user to enter either 1,2,3,4,5 or 6. Display however many jokes the user has requested in the reverse order that they were added to the stack (You must use your own stack data structure and submit working stack code). c) (3 marks). Would your stack still work if there was a requirement for the user to be able to select any one of the funny jokes to be printed? If you were to add a feature to it to allow this operation to work, would a linked list a good choice as the data structure inside the stack for this kind of algorithm or would an array-based stack work better? Justify your answer with reference to Big O time complexity

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!