What is Data Structure?
In simple term we can define data structure as, Data Structure is a way of organizing the data elements in memory so that we can efficiently retrieve it and perform any operation efficiently.
Now, before moving forward on next topics lets have a eyes over theĀ syllabus of data structure which questions and answers you will find on this website on other page.
Data Type
It describes which type of value can be stored by a variable. suppose if a variable has int data type it means that that variable can only hold the integer values.
It is of two types:-
1). Primitive data type
2). non-primitive data type
For more detail, you may refer below URL.
Now letās move on the next topics āAlgorithmā
An algorithm is a finite steps solution of a problem in a human-readable format. Every algorithm has some space and time complexity which denotes how much an algorithm is efficient.
Five asymptotic notations are Big-Oh notation, Omega notation, Theta notation, little O and little omega to measure the efficiency.
I hope you got a little bit idea of an Algorithm.Ā
Array and Linked List
An array is a collection of similar type of elements which is stored in contiguous memory locations. A here similar type of element means each element have the same data type.
We can denote it as
int arr[] ;
Means arr is an array in which we can only assign integer type of elements.
An array is Basically of two types:
1). One dimensional or single dimensional array
2). Multidimensional Array
Representation of an Array:
We can represent array in two ways
1). Row Major Order
LOC (A [i, j]) = base_address + W [M (i) + j] Here,
base_address = address of the first element in the array.
W = Word size means a number of bytes occupied by each element of an Array.
N = Number of rows in the array.
M = Number of columns in the array.
LOC (A [i, j]) = base_address + W [N (j) + (i)]
Here,
base_address = address of the first element in the array.
W = Word size means a number of bytes occupied by each element of an Array.
N = Number of rows in the array.
M =Ā Number of columns in the array.
Linked List
Linked List is a linear and dynamic data structure. It stores elements at non-contiguous memory locations.
Linked List is of different types:
2). Doubly Linked List
We have seen some basics of Array and Linked List
Searching and Sorting
Searching: It is an operation to find a particular element in a list or in array.
Types of searching
- Linear Search
- Binary Search
- Hash Search
- Binary Tree Search
Sorting: It is also an operation on elements of an array or linked list to arrange it either in ascending or descending order.
Types Of Sorting
- Insertion Sort
- Bubble Sort
- Selection Sort
- Quick Sort
- Merge Sort
- Heap Sort
- Radix Sort
I think we can wrap up here. For more detail you can follow given link
Graph and Tree
Graph : A Graph is a non-linear and abstract data structure which consist of nodes and edges. A single edge connects two Vertices in graph.
We Can Traverse the node of graph by using two algorithms
- BFS ( Breadth First Search)
- DFS (Depth First Search)
Tree : Tree is also a non-linear data structure that consists node which is connected using edge. But in tree all node are arrange as root node, parent node and child node in hierarchical manner.
Minimum cost spanning tree : It is a subset of tree and graph in which sum of the weight to traverse each node is minimum. A tree has many number of spanning tree but not all are minimum spanning tree.
There are some algorithm to identify minimum spanning tree.
- Primās Algorithm
- Kruskalās Algorithm
Stack and Queue
Stack: Stack is an abstract data type which follow the LIFO ( Last In First Out) Principle.
We can perform only two operation on stack
1). PUSH
2). POP
Stacks are used to evaluate post-fix expression.
Recursion : Recursion is a process in which one function calls it self again and again for a finite time to solve a given problem.
Queue: Queue is also a abstract data type which follow FIFO(First In First Out Principle).
2 Operations can be performed on Queue
1). enqueue
2). dequeue
Enqueue means put elements in queue and dequeue means remove it from queue.
For more details and semester question answers please follow the given link.
Similar Reads
-
Multiplications of Two variable polynomial
Polynomial multiplication is a common operation in algebra, used in areas such as scientific computing, engineering simulations, and symbolic algebra… -
Subtraction of Two-Variable Polynomial in C
Polynomials with two variables are common in engineering, graphics, and scientific computation. While addition is frequently discussed, subtraction is equally… -
Explain the Addition of Two variable polynomial
Polynomials are fundamental in mathematics, and their use extends into computer science, engineering, physics, and more. While single-variable polynomials are… -
Reverses the Doubly Circular Linked List
Algorithm to Reverse a Doubly Circular Linked List Check if the List is Empty or Has Only One Node: If… -
Algorithm and Program in C to traverse Doubly Circular Linked List
A doubly circular linked list is a special type of linked list in which every node is connected to both… -
Polynomial representation Using Array
Polynomials are fundamental mathematical expressions used extensively in various fields. Representing them efficiently in programming is crucial for calculations and… -
Multiplication of Single Variable Polynomial : Algorithm and Program
Multiplication of single-variable polynomials is a fundamental operation in polynomial algebra. The process involves multiplying each term of one polynomial… -
Subtraction of Single variable Polynomial : Algorithm and Program
Subtracting single-variable polynomials involves reducing each corresponding term of the polynomials from each other. This process is similar to addition,… -
Addition of Single variable Polynomial : Program and Algorithm
The addition of single-variable polynomials is a fundamental concept in algebra, often encountered in mathematics and computer science. Let's break… -
Polynomial Representation Using Linked List
Polynomial representation using linked lists is a critical concept in computer science and mathematics. In this guide, we explore how…