Last in First Out: Linked List, Tree, Etc. A Programmer Selects An Appropriate Data Structure and Uses It
Last in First Out: Linked List, Tree, Etc. A Programmer Selects An Appropriate Data Structure and Uses It
The C Programming language has many data structures like an array, stack, queue,
linked list, tree, etc. A programmer selects an appropriate data structure and uses it
according to their convenience.
Array
Stack
Queue
Linked List
Trees
Hashing
ARRAY
Basic Operations
Following are the basic operations supported by an array.
Traverse - print all the array elements one by one.
Insertion - Adds an element at the given index.
Deletion - Deletes an element at the given index.
Search - Searches an element using the given index or by the value.
Update - Updates an element at the given index.
LIFO
STACK
QUEUE
A Queue is a linear data structure that stores a collection of elements. The queue
operates on first in first out (FIFO) algorithm.
LINKED LIST
A Linked List is a data structure. It is linear. The Linked List is like an array but, the Linked
List is not stored sequentially in the memory. Every linked list has 2 parts, the data
section and the address section that holds the address of the next element in the list,
which is called a node.
TREES
HASHING
Graph:
In this case, data sometimes hold a relationship between the pairs of elements
which is not necessarily following the hierarchical structure. Such data structure is
termed as a Graph.
A[5]
1
2
3
4
5
6