Data Structures
Data structures is a way to organize computer data effectively .There are different kind of data structures and we are going to discuss about couple of them here. Those data structures are used to structure the data in the memory using any kind of programming languages.
- Array
- Linked list
- Stack
- Queue
- Binary tree
- Binary hash tree
- Binary Search Tree
- Heap
- Hashing
- Graph
- Matrix
- Misc
- Advanced Data Structure
Array
Array is a collection of multiple items with a same type at contiguous memory locations .The items stored in the array called as elements and the location of the element of the array is identified using numerical index. The total number of elements in an array is called as length .Arrays are better for processing , sorting and searching values .

Linked list
A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers .Linked list is the second most-used data structure after array .Basic operations of a linked list,
- Insertion − Adds an element at the beginning of the list.
- Deletion − Deletes an element at the beginning of the list.
- Display − Displays the complete list.
- Search − Searches an element using the given key.
- Delete − Deletes an element using the given key.
Stack
A stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example — a deck of cards or a pile of plates, etc.
A real-world stack allows operations at one end only. For example, we can place or remove a card or plate from the top of the stack only. Likewise, Stack ADT allows all data operations at one end only. At any given time, we can only access the top element of a stack .
basic operations of a stack
- push() − Pushing (storing) an element on the stack
- pop() − Removing (accessing) an element from the stack
- peek() − get the top data element of the stack, without removing it
- is Full() − check if stack is full
- is Empty() − check if stack is empty
Queue
Queue is an abstract data structure which is similar to Stacks. Unlike stacks, a queue is open at both its ends. One end(front end)is always used to insert data (enqueue) and the other(back end) is used to remove data (dequeue). Queue follows First-In-First-Out methodology(FIFO),the data item stored first will be accessed first .
A single-lane one-way road can be identified as a real world example of queue , where the vehicle enters first and exits first . vehicles enter from an one end and exists from other end .There are basic operations associated with queues.
- enqueue() − add (store) an item to the queue.
- dequeue() − remove (access) an item from the queue
- peek() − Gets the element at the front of the queue without removing it.
- is full() − Checks if the queue is full.
- is empty() − Checks if the queue is empty

Binary tree
A tree whose nodes have at most 2 children is called a binary tree. Since each element in a binary tree can have only 2 children, we typically name them the left and right child .Binary tree is a special data structure used for data storage purposes .node’s left child must have a value less than it’s parent’s value and the node’s right child have a value greater than its parent value .
There are some important terms for tree .
- Path − Path refers to the sequence of nodes along the edges of a tree.
- Root − The node at the top of the tree is called root. There is only one root per tree and one path from the root node to any node.
- Parent − Any node except the root node has one edge upward to a node called parent.
- Child − The node below a given node connected by its edge downward is called its child node.
- Leaf − The node which does not have any child node is called the leaf node.
- Subtree − Subtree represents the descendants of a node.
- Visiting − Visiting refers to checking the value of a node when control is on the node.
- Traversing − Traversing means passing through nodes in a specific order.
- Levels − Level of a node represents the generation of a node. If the root node is at level 0, then its next child node is at level 1, its grandchild is at level 2, and so on.
- keys − Key represents a value of a node based on which a search operation is to be carried out for a node .