1.what is Data Structure?
- A data structure is a memory used to store and organize data
- It is also used for processing, retrieving, and storing data
2. what is classification of Data Structure?
2.1 what is Linear data structure?
- Data structure in which data elements are arranged sequentially or linearly, where each element is attached to its previous and next adjacent elements, is called a linear data structure.
- Examples of linear data structures are array, stack, queue, linked list, etc
2.2 what is Non-linear data structure?
- Data structures where data elements are not placed sequentially or linearly are called non-linear data structures.
- Examples of non-linear data structures are trees and graphs.
2.3 what is Static data structure:?
- Static data structure has a fixed memory size.
- It is easier to access the elements in a static data structure.
- An example of this data structure is an array.
2.4 what is Dynamic data structure?
- In dynamic data structure, the size is not fixed.
- It can be randomly updated during the runtime
- Examples of this data structure are queue, stack, etc.
2.5 what is Array?
- An array is a collection of data items stored at contiguous memory locations.
2.6 what is Linked List?
- Like arrays, Linked List is a linear data structure.
- Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked using pointers.
2.7 what is Stack?
- Stack is a linear data structure
- The order may be LIFO(Last In First Out) or FILO(First In Last Out).
- In stack, all insertion and deletion are permitted at only one end of the list.
mainly the following three basic operations are performed in the stack:
Initialize
: Make a stack empty.
Push
: Adds an item in the stack. If the stack is full, then it is said to be an Overflow condition.
Pop
: Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition.
Peek or Top
: Returns top element of the stack.
isEmpty
: Returns true if the stack is empty, else false.
2.8 what is Queue?
- Queue is a linear structure
- The order is First In First Out (FIFO).
- In the queue, items are inserted at one end and deleted from the other end.
2.9 what is Binary Tree?
- Binary Tree are hierarchical data structures.
- A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child.
- It is implemented mainly using Links.
- a pointer to the topmost node in the tree. If the tree is empty, then the value of root is NULL
2.10 what is Binary Search Tree?
- The left part of the root node contains keys less than the root node key.
- The right part of the root node contains keys greater than the root node key.
- There is no duplicate key present in the binary tree.
2.11 what is Heap?
- A Heap is a special Tree-based data structure in which the tree is a complete binary tree.
- Heaps can be of two types: