STACK AND QUEUE DATA STRUCTURES: ALGORITHMS, APPLICATIONS AND EFFICIENCY ANALYSIS
DOI:
https://doi.org/10.55640/Keywords:
Stack, Queue, LIFO, FIFO, data structures, algorithm complexity, deque, priority queue, BFS, DFS, function call stack, circular buffer, monotonic stack, task scheduling, expression evaluation.Abstract
Stack and queue are two foundational linear data structures that underpin a vast array of algorithms and computing systems. This article provides a comprehensive examination of the stack (Last-In, First-Out — LIFO) and queue (First-In, First-Out — FIFO) data structures, detailing their operational principles, algorithmic implementations, time and space complexity analyses, and practical applications. The stack is widely employed in function call management, expression evaluation, syntax parsing, and backtracking algorithms, while the queue plays a central role in process scheduling, breadth-first graph traversal, printer spooling, and buffering systems. The article demonstrates how both structures can be implemented using arrays and linked lists, compares their performance characteristics, and discusses advanced variants such as the deque (double-ended queue), priority queue, circular queue, and monotonic stack. Special attention is given to real-world use cases in operating systems, compilers, network packet routing, and artificial intelligence. The article also highlights common implementation pitfalls, including stack overflow, queue underflow, and memory management issues, and provides algorithmic solutions to classic problems — such as balanced parentheses checking, next greater element, and task scheduling — to illustrate the practical power of these structures.
Downloads
References
1.Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press.
2.Sedgewick, R., & Wayne, K. (2011). Algorithms (4th ed.). Addison-Wesley Professional.
3.Knuth, D. E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd ed.). Addison-Wesley.
4.Skiena, S. S. (2008). The Algorithm Design Manual (2nd ed.). Springer.
5.Goodrich, M. T., Tamassia, R., & Goldwasser, M. H. (2014). Data Structures and Algorithms in Python. Wiley.
6.Shaffer, C. A. (2013). Data Structures and Algorithm Analysis (3rd ed.). Dover Publications.
7.Tarjan, R. E. (1972). Depth-first search and linear graph algorithms. SIAM Journal on Computing, 1(2), 146–160. DOI: 10.1137/0201010.
8.Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269–271. DOI: 10.1007/BF01386390.
9.Huffman, D. A. (1952). A method for the construction of minimum-redundancy codes. Proceedings of the IRE, 40(9), 1098–1101. DOI: 10.1109/JRPROC.1952.273898.
10.U.M. Ibragimov, B. Ergashev. Important aspects of collecting Windows operating system data for the pentest process. Conference: Collection of papers from the international scientific and practical conference on the topic "The role of digital technologies in the economy and education.". Uzbekistan (Samarqand). 2024. p. 30–33.
11.U.M. Ibragimov. Effectiveness and efficiency of the PROMETHEUS system. XVI Saginovsky Readings. Integration of Education, Science and Production. Kazakhstan (Karaganda). 2024. p. 237–239.
12.Williams, J. W. J. (1964). Algorithm 232 — Heapsort. Communications of the ACM, 7(6), 347–348.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors retain the copyright of their manuscripts, and all Open Access articles are disseminated under the terms of the Creative Commons Attribution License 4.0 (CC-BY), which licenses unrestricted use, distribution, and reproduction in any medium, provided that the original work is appropriately cited. The use of general descriptive names, trade names, trademarks, and so forth in this publication, even if not specifically identified, does not imply that these names are not protected by the relevant laws and regulations.

Germany
United States of America
Italy
United Kingdom
France
Canada
Uzbekistan
Japan
Republic of Korea
Australia
Spain
Switzerland
Sweden
Netherlands
China
India