Data Structure Tutorial

What is Sorting Arrays?

Sorting Arrays We encounter several applications that require an ordered list. So it is required to order the elements of a given list either in ascending/increasing order or descending/decreasing order, as per the requirement. This process is called sorting. Sorting Array using Bubble Sort Bubble sorting is a simple sorting technique in which we arrange the elements of the list …

What is Sorting Arrays? Read More »

Working with Stacks | Stack and Queue Data Structure

Working with Stacks A stack is simply a list of elements with insertions and deletions permitted at one end—called the stack top. That means that it is possible to remove elements from a stack in reverse order from the insertion of elements into the stack. Thus, a stack data structure exhibits the LIFO (last in first out) property. Push and pop are the operations that are provided for …

Working with Stacks | Stack and Queue Data Structure Read More »

Working with Queues | Stack and Queue Data Structure

Working with Queues One of the applications of the stack is in expression evaluation. A complex assignment statement such as a = b + c*d/e–f may be interpreted in many different ways. Therefore, to give a unique meaning, the precedence and associativity rules are used. But still it is difficult to evaluate an expression by computer in …

Working with Queues | Stack and Queue Data Structure Read More »

Sorting and Reversing Link List | Linked List Data Structure

Sorting and Reversing Link List Introduction To sort a linked list, first we traverse the list searching for the node with a minimum data value. Then we remove that node and append it to another list which is initially empty. We repeat this process with the remaining list until the list becomes empty, and at …

Sorting and Reversing Link List | Linked List Data Structure Read More »