Data Structure

Data Structure

Explain Linear and Non-Linear data structure
Pinterest LinkedIn Tumblr

Linear data structure

A linear data structure traverses the data items sequentially. The retrieval access only one data element at a time

It can further divide into Index Based and Non-Index based data structure. The index-based data structure can traverse the items through the index. Example Array. The Nonindex based data structure do not have an index and retrieve the item using the head or root of the element. Example Linked List, stack, Queue.

Non-Linear data structure

The data elements are not organized in a sequential order. The data items are linked with other items and cannot be traversed in a single run. Example Hashtable, Tree, Set and Priority Queue

The Tree can further divide into NonBalance and Balance Tree. The Unbalance tree does not balance the tree and maintain the insertion order. Example Trie, Binary Search Tre, B-Tree and Binary Tree. The Self Balancing tree balance the tree automatically while inserting the item in the tree. Example Red Block Tree, AVL Tree, and Splay Tree

Write A Comment