Here is the listing of C programming examples on Stacks & Queues.
1. C Examples on Stack Implementation
A Stack is a data structure which is used to store data in a particular order. Two operations that can be performed on a Stack are: Push operation which inserts an element into the stack. Pop operation which removes the last element that was added into the stack. It follows Last In First Out(LIFO) Order. The following section consists of C Programs dealing with Stack. The section deals with various implementations of Stacks, to reverse a Stack using recursion and without using recursion, to implement two Stacks using a single array and check for Overflow and Underflow conditions and implementing a Stack using linked list. A stack overflow is an undesirable condition in which the program tries to use more memory space than the call stack has available. If a Stack is empty and yet a Pop operation is attempted, then it results in Stack Underflow condition.
2. C Examples on Queue Implementation
A Queue is a linear data structure which basically stores the data sequentially. It follows First In First Out(FIFO) order. The following section deals with various implementations of Queue. It contains programs to implement Queue using an array, linked list and to implement a priority queue to add and delete elements. In a priority queue, values come out in order by priority.
C Program to Implement a Queue using an Array
C Program to Implement Queue Data Structure using Linked List
C Program to Implement Priority Queue to Add and Delete Elements
3. C Examples on String Implementation
The following section illustrates the use of data structures like Stacks and Queues for string implementations. It contains programs which checks if a given string is palindrome using stack and without using stack and a program to check if the given expression is correctly parenthesized.
C Program to Check String is Palindrome using Stack
C Program to Check if Expression is correctly Parenthesized
C Program to Identify whether the String is Palindrome or not using Stack
4. C Examples on Queue Implementation using Other Data Structures
The following section demonstrates the implementation of Queue using other data structures. It contains programs to implement queue functions using Dynamic Memory Allocation, using arrays and macros and implementation of queue using stack. Dynamic Memory Allocation enables us to create data types and structures of any size and length to suit our program’s need within the program.
C Program to Implement various Queue Functions using Dynamic Memory Allocation
C Program to Implement Queue Functions Using Arrays and Macros
C Program to Implement Queues using Stacks
5. C Examples on Other Stack Implementations
The following section demonstrates other implementations of Stack. It contains programs to illustrate stack operations using MACROS and to implement operations of a stack using Dynamic Memory Allocation.
C Program to Illustrate Stack Operations using MACROS
C Program to Implement Stack Operations using Dynamic Memory Allocation