Data Structures are special mechanisms in computer programming which help us in storing and retrieving data in different ways. For example, if we wish to store the list of all persons invited for an event, we might use an array data structure which holds all the data sequentially. However if we need to quickly determine if a particular person is invited the event, we might use a better alternative like hash maps.
In this section, we will go through most of the basic and advanced types of data structures and look at scenarios where each type of data structure excel in. Below are all the data structures explained so far:
Array Data Structure
An array is a data structure used to store a collection of items in a continuous memory block. The memory allocated to the array is divided into multiple sequential slots and each slot can exactly store the information of an item.
Read More
Linked List Data Structure
A Linked list is a data structure that can store a collection of items. All the items in a linked list are stored in the form of a chain made up of multiple nodes. Each node stores an item and also points out (links) to the next node in the chain.
Read More
Hash Table Data Structure
A Hash table (also known as a hash map) is a data structure used to store a set of items and retrieve any stored item quickly using key associated with the item. Every item stored in a hash table is stored against a key unique to the item.
Read More
Stack Data Structure
A stack is an abstract data structure which is used to store a collection of elements with the ability to add or remove elements at only one endpoint (often called the top). Due to this property of a stack which allows addition or removal of elements only from one endpoint, a stack is also known as a Last In First Out (LIFO) data structure.
Read More
Queue Data Structure
Queue is an abstract data structure (ADT) which replicates the queue we observe in public places like check-in counters, ticket counters etc. Queue data structure allows us to add or remove elements into a virtual queue. The new elements are added to the rear end of the queue and elements are removed from the front end of queue.
Read More
Binary Heap Data Structure
A Binary heap is a data structure used to efficiently find the maximum or minimum element among a collection of elements. If a binary heap is configured to find or retrieve the maximum element among all the elements in the heap, the heap is called as a max-heap.
Read More
Prefix Tree (Trie) Data Structure
A trie, also called as prefix search tree, is a data structure used to store a set of words or strings. It can be used to efficiently store a large number of words and quickly find if a particular word/string is present in the trie.
Read More
Binary Indexed (Fenwick) Tree
Binary Indexed tree, also called as Fenwick tree is a type of data structure used to efficiently query for range sums on an array of values. Range sums / prefix sums are the totals of all the numbers between a certain start and end points in an array/list.
Read More