Welcome to Krivalar Data Structures tutorial. In this tuorial, we will learn about List Abstract Data Type (ADT), Linked List, Singly Linked List, Doubly Linked List, Stack ADT, Queue ADT, Tree ADT, Tree Traversal, Binary Tree, Binary Tree Traversal, Depth First Traversal, Breadth First Traversal, Hash Table, Heap, Expression Tree, AVL Tree and Shortest Path Algorithms.
World is all about Data. Data can be organized depending on its primary use and secondary uses. It can be used for retrieval, processing, faster insertion, faster updates and faster maintenance. The way in which data is organized in memory or storage is called Data Structure. Each data structure provides a different way to organize data. This tutorial provides detailed explanation of each of the data structure mentioned above and also the algorithms involved.
This page is for programmers, engineering students and anyone who love coding and would like to play with data. There are many many ways to organize data. You can organize data in a list, tree, graph, map, or table or any other data structure.
Data structure can either be linear or non-linear. Basic operations on data structures include insertion, deletion, searching, find and sorting
- Linear Data Structures
- Storing data along a single line. Example: Lists, Stacks, Queues
- Non-Linear Data Structures
- Storing data other than linear fashion. It can be in hiercharchial order or any other non-linear style
Example: Trees, Graphs
Data can be linearly arranged in different ways
- Stack: you can add and remove data at one end only. In this case, you always remove the data that you recently added. This is call Last In First Out approach (LIFO). Stack is like a box in which you keep putting books one over the other. You can only pick up books one by one from the top.
- Queue: you can add data at the end and remove data at the other end. In this case, you service the data you added first. In a queue,you always serve the customer who came first and stood in the queue.
- Priority Queue: A queue with each value having a priority.
- Double ended queue: You can add and remove data at the both ends in a double ended queue. Double ended queue is sometimes called as Dequeue or Deque which is misleading as it also refers to remove element from a queue and hence the terminology "Dequeue" should never be used.
- Singly Linked List: A list in which element has a link to the next element
- Double Linked list: A list in which element has a link to the next element and a link to the previous element except that first node in the list does not have a previous link and last node does not have a next link
- Circular Linked List: A single or double linked list in which the last node has a link to the first node
A tree can be structured in different ways.A Tree is a data structure with one root data. Root can have one or more children. Child node can have zero or more children
- Trie: A search tree in which each node has a prefix of its parent.
- Binary Tree: A tree in which each parent has maximum of two children
- Binary Search Tree: Sorted Binary Tree
A graph is a data structure with nodes and edges with edges connecting the nodes. Graphs can be undirected or directed