Stacks, Queues, and Search Algorithms in Programming Coursework

Exclusively available on IvyPanda Available only on IvyPanda

Stacks and queues are two similar abstract data types (ADT) that build on the linked list, though they can be implemented using vectors or arrays, instead. They limit the base ADT’s functionality by restricting access to elements at either end of the list. The queue allows reading elements from the tail; the stack, conversely, grants read access to the elements at its head. Both ADTs only allow elements to be added at the head. Thus, the queue is a first in, first out (FIFO) structure, while the stack is a first in, last out (FILO) structure.

We will write a custom essay on your topic a custom Coursework on Stacks, Queues, and Search Algorithms in Programming
808 writers online

These ADTs are useful for situations where elements are added onto the structure over time but should be accessed or processed only in the same order they were added or the opposite. For instance, stacks are often used as part of undo/redo functionality in applications (Geeksforgeeks, 2021). Queues, meanwhile, see use in order processing or message routing systems to ensure requests are processed in the order they were created (Tang, 2013). Ultimately, the critical factors in deciding to use stacks or queues rather than other ADTs are the necessity to only access data in a specific order. The decision between a queue and a stack depends on the specific order in question, as described by the structures’ FIFO or FILO definitions.

Various sorting algorithms allow one to order a set of data in a list or array according to some comparable attribute. Alphabetical ordering and order by number are some of the most obvious examples. One can combine algorithms for efficiency and effectiveness; for instance, binary search is generally an efficient search algorithm; however, it can only work on an ordered collection. Therefore, it stands to reason that a collection (array or list) that must be searched often should be sorted first to achieve higher efficiency and, thus, better performance. Furthermore, one can use a sorting or search algorithm when adding new elements to a collection to ensure that the data contained within is always sorted. This approach saves processing time on searching for specific elements at the cost of performance when adding new elements.

Reference

Geeksforgeeks.com (2021). .

Tang, D (2013). CS240 — Lecture Notes: Queues. Cpp.edu. Web.

Print
Need an custom research paper on Stacks, Queues, and Search Algorithms in Programming written from scratch by a professional specifically for you?
808 writers online
Cite This paper
Select a referencing style:

Reference

IvyPanda. (2023, February 7). Stacks, Queues, and Search Algorithms in Programming. https://ivypanda.com/essays/stacks-queues-and-search-algorithms-in-programming/

Work Cited

"Stacks, Queues, and Search Algorithms in Programming." IvyPanda, 7 Feb. 2023, ivypanda.com/essays/stacks-queues-and-search-algorithms-in-programming/.

References

IvyPanda. (2023) 'Stacks, Queues, and Search Algorithms in Programming'. 7 February.

References

IvyPanda. 2023. "Stacks, Queues, and Search Algorithms in Programming." February 7, 2023. https://ivypanda.com/essays/stacks-queues-and-search-algorithms-in-programming/.

1. IvyPanda. "Stacks, Queues, and Search Algorithms in Programming." February 7, 2023. https://ivypanda.com/essays/stacks-queues-and-search-algorithms-in-programming/.


Bibliography


IvyPanda. "Stacks, Queues, and Search Algorithms in Programming." February 7, 2023. https://ivypanda.com/essays/stacks-queues-and-search-algorithms-in-programming/.

Powered by CiteTotal, online bibliography maker
If you are the copyright owner of this paper and no longer wish to have your work published on IvyPanda. Request the removal
More related papers
Cite
Print
1 / 1