A Data Structure is a data organization, storage format and management that enables efficient access and modification.
There are three types of data structures:
Array is a data structure consisting of values or variables and each identified by array index.
Let’s take an example of simple Array below:
In this example, We have array consist of integer values. We can access element by index from 0 to 4. When we check array, it will populate value 1, for array it will be 2 and so on.
Array is widely used data structure, we can store image data in array, JSON objects, user details and many more. It is very easy to process data and access it by using index.
Linked List is a collection of data elements whose order is given by each element. Each element points to what is the next element.
A linked list is a sequence of data structures, which are connected together via links.
Stack is linear data structures that follow the Last In First Out (LIFO) principle. That means, the item got inserted last will get out first.
For example, you have a stack of trays on a table. The tray at the top of the stack is the first item to be moved if you require a tray from that stack.
|Binary Search Tree|