Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Critical thinking questions: a). Give an example of an application where it woul

ID: 667211 • Letter: C

Question

Critical thinking questions:

a). Give an example of an application where it would be appropriate to organize data into a stack

b). Give an example of an application where it would be appropriate to organize data into a queue

c. Given an example of an application where it would be appropriate to organize data into an ordered list

d. What are the benefits of using an ordered list vs. an unordered list? What are the costs?

e. Why is it easier to implement stacks, queues, and ordered lists with linked lists than with arrays?

Explanation / Answer

a.

a.Towers of hanoi is one the application used to describe stack.stack implements LIFO last in first out
b.Movie Tickets ,Buying Pizza, or Buffer, these kind of application are good to describe Queue.Queue implements FIFO first in first out

c.Ranking app or Index..applications . these are good examples to describe the Ordered lists.
in ordered lists the given data is sorted and arranged in particular given order
d.
i. In ordered lists searching can be done easily in less time whereas in unordered lists searching takes more time .
ii. No need of using Sorting algorithms in Unordered lists whereas sorting algorithms
must be used in ordered lists.
iii.data will be placed anywhere in unordered lists. but in ordered lists data is placed in particular order.
iv.Costs of ordered lists depends sorting algorithms and costs of unordered lists depends on searching algorithms used

e.it is it easier to implement stacks, queues, and ordered lists with linked lists than with arrays because in the linked-list implementation, one pointer must be stored for every item in the stack or queue, while the array stores only the items themselves and also the space used for a linked list is always proportional to the number of items in the list. This is not necessarily true for the array implementation . because if a lot of items are added to a stack/queue and then removed, the size of the array can be arbitrarily greater than the number of items in the stack or queue.
For the array implementation, the worst-case times for the push and enqueue methods are O(N), for a stack/queue with N items. This is because when the array is full, a new array must be allocated and the values must be copied.
For the linked-list implementation, push and enqueue are always O(1).

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote