Different Types of Data-Structures


Different Types of Data-Structures

ARRAY :

The array is a type of data structure that stores the same type of elements, in contiguous address types. The programmer can use an array in the following cases:

  • Need access to the elements using the index/address values.
  • Know the size of an array before defining the memory for use.
  • Require speed when iterating through all the elements in a sequence.

LINKED LIST :

A linked list is a data structure that links each node to the other(next) node by linking them by using their address. The programmer can use it in the following cases:

  • Need of constant time for insertion and deletion operations.
  • Allow data growing dynamically.
  • No need to access random elements from the list.
  • Insert the data elements in any position of the list.

CIRCULAR LINKED LIST :

A circular linked list is a type of linked list in which the link field of the tail node is linked to the head node so that they form a circular structure. The developer can use a circular linked list in the following cases.

  • For development of buffer memory.
  • Representing a deck of cards in a game.
  • Creating browser cache which in results allowing hitting the BACK button.
  • Implementation of Most Recently Used (MRU) list in the MRU algorithm.
  • Using Undo functionality in Photoshop or Word.

DOUBLY LINKED LIST :

Doubly linked is a type of data structure in which each node contains three variables namely, data and two address links. One link points to the previous node and another link points to the next node. The developer can use a doubly linked list in the following cases.

  • Need of iteration in reverse order without recursion implementation.
  • Insertion or removal from doubly-linked lists is faster so is being used in the browsers navigation function from one page to another backward or in forwards.

STACK

The stack is a data structure based upon the LIFO(last-in-first-out) concept. The developer can use the stack in the following cases.

  • Evaluation and syntax parsing of an expression.
  • Finding the correct path in a maze/2-d matrix using backtracking algorithms.
  • Runtime memory management operations.
  • Recursive functions.

QUEUE :

The queue is a data structure based upon the FIFO(first-in-first-out) concept. The developer can use Queue in the following cases.

  • When the programmer wants an order.
  • If the programmer wants to add or remove both ends, they can use the queue or a double-ended queue for this operation.

BINARY TREE :

A binary tree is a data structure in which each node has at most two child nodes in a hierarchical system like a tree also it acts as a valid binary tree. The programmer can use Binary Tree in the following cases.

  • Find the name in the phone book.
  • Sorted traversal of the tree.
  • Find the next closest element.
  • Find all elements less than or greater than a certain value.

BINARY SEARCH TREE(BST) :

A Binary Search Tree is a tree data structure in which the value of the root node is less than or equal to the values of the left sub-tree and greater than or equal to the right sub-tree. The programmer can use Binary Search Tree in the following cases.

  • Use when the data need to be sorted.
  • Search can be done for a range of values.
  • Height balancing helps to reduce the running time.

HEAP :

A heap is a specialized tree-based abstract data type that satisfies the heap property(i.e. the value of node must be always >= or <=, from the values of its children). The programmer can use Heap in the following cases.

  • Implementation of Priority Queue.
  • Whenever a programmer needs quick access to the largest (or smallest) item in a list or sequence.
  • Good enough for selection algorithms (for finding the min or max).
  • Operations tend to be faster than that of a binary tree.
  • Heap sorting methods are being used in-places and with no quadratic worst-case scenarios.
  • Graph algorithms use heaps as internal traversal data structures as the run time gets to be reduced by polynomial order.

HASHING :

Hash-table is a data structure used to implement an associative array, a structure that can map keys to values in an efficient way so that they can be accessed quickly. The developer can use a Hash table in the following cases.

  • Need constant time for operations.
  • Insertions are generally slow, redemption(read) is faster than trees.
  • Hashing is used in DBMS so that searching a database can be done in a faster manner.
  • Internet routers use hash-tables to route the data from one computer to another.
  • The internet search engines use a hash function to work effectively.

GRAPH :

The graph is an ADT(abstract data type) that is meant to implement the graph and directed graph concepts from mathematics. The programmer can use the graph in the following cases.

  • Networking have many uses in the practical side of graph theory.
  • Finding the shortest path between the cities.
  • Solve the maze game.

MARIX :

Matrix is a data structure that stores the data using rows and columns as similar to our 2D-arrays. The programmers can use Matrix in the following cases.

  • Matrix can be used for arithmetic implementation in graphic processing algorithms.
  • Implementation of the graph.
  • Representation of quadratic forms and linear algebra solutions.

B-TREE :

B-tree is a data structure that maintains data sorted and allows searches, sequential accesses, insertions, and deletions in logarithmic time complexity. The programmer can use B-Tree in the following cases.

  • File systems.
  • Database management system operations.

AVL TREE :

AVL(Adelson Velskii and Landis) tree, the shape of the tree is constrained/changed at all times such that the tree shape is balanced. The height of the tree never exceeds O(log n). The programmer can use AVL Tree in the following cases.

  • When the programmer wants to control the tree height outside -1 to 1 range.
  • Quick and fast search for an element.

Post a Comment

0 Comments