- A stack represents a linear data structure adhering to the Last In First Out (LIFO) principle. Elements are accessed, inserted, and deleted from the end, commonly referred to as the top, of the stack.
- A stack can be used to convert infix to postfix.
- A queue represents a data structure adhering to the First In First Out (FIFO) principle. A queue represents a waiting list. It can be seen as a specialized form of list where elements are inserted at the end (tail) of the queue and accessed and removed from the beginning (head) of the queue.
- a priority queue assigns priority levels to its elements. When accessing elements, those with the highest priority are dealt with first, reflecting a largest-in, first-out behavior.
- A deque, or double-ended queue, resembles a queue in that it's an ordered assortment of items. However, it differs in that it features two ends: a front and a rear, where items maintain their position. This structure allows for the addition of new items at either end and the removal of existing items from either end as well.
Python Programming
-
- 8-1. Why Functions?
- 8-2. The Syntax of Function Definition
- 8-3. Void Functions and Value Returning Functions
- 8-4. Function Arguments and Parameters
- 8-5. The if __name__ == "__main__": Statement
- 8-6. The yield Statement
- 8-7. Nesting Function Calls
- 8-8. Calling from the Call
- Summary
- Programming Exercises
Summary
Last updated: April 23, 2025