Overview Of Data Structures And Algorithms
This post will give you the clear idea about learning data structures and algorithms. So, Data structure? => In computer science a data structure is a data organization , management and storage format that enables efficient access and modification. Or in the other words it is a way in which data is stored on a computer.
Types of data structures:-
Array
String
Stack
Queue
Linked List
Binary Tree
Binary Search Tree
Heap
Hash Table
Graph
Above topics, array is a linear data structure which stores the data in the sequence order, dynamic array, every data is stored in the next contiguous memory location.
String is a collection of characters. If it contains the alphabets and it also uses the digit as character. If a string is composed of numbers and characters then numbers are also treated as characters.
Stack is also a linear data structure. It works either on Last In First Out or First In Last Out. It has only one entry and exit side, From one side the pushing of element and popping of element. A pointer is used to allocate the current memory location on the stack.
Queue works on the principal of First In First Out. It has two ends, front and back. The front contains the starting index of the queue and the end contains the last index of the queue element, stack queue.
Linked list is also a linear data structure. In this there is a node which contains the data and address of the next node. Whenever a node is created it is created with a data field and a node type pointer which points to the next node in the linked list.
Linked list is of Three types:-
Single Linked List
Doubly Linked List
Circular Linked List
In Singly Linked List, there is a node which contains the data and address of the next node. Whenever a node is created it is created with a data field and a node type pointer which points to the next node in the linked list.
Doubly linked list , there are two pointers, first is the next pointer and second is the previous pointer. First pointer points to the address of the next node like in the single linked list , next pointer does and second pointer previous points to its previous node in the linked list, also a data field is associated with the node.
In the Circular linked list, it forms a loop in the list. In this head points to the first node in the linked list and there is no node null, last node does not point to the NULL. Last node always point to the first or head node of the list.
Binary Tree is a non- linear data structure. It contains a root node and it has at most two child nodes. Binary Search Tree is as the Binary Tree , in this searching is done in-order, pre-order and in post-order.
Heap is used to find the mean heap and max heap of a given array. It is the best method to find the maximum and minimum of an array.
Hash Table is mainly used to find the frequency of a number or a character in an array or in a string. It uses the key- value pair to store the result of the problem.
Graph is a non-linear data structure. It can be used to find the cycle in the give problem such as to check the given tree is a spanning tree or not. If the given graph forms a cycle then it is not a spanning tree else the given graph is a spanning tree.
Above all the topics are of the data structure and a clear description about each and every topic of the first section. Now definition of algorithm and its topics.
Algorithms:- Finite set of steps to solve a problem, comparison with respect to the Time complexity and the Space complexity of the problem.
Important topics of the Algorithm:-
Asymptotic Analysis
sorting
searching
Randomized Algorithms
General Recursion
Back Tracking
Branch And Bound
Divide And conquer
Greedy Algorithms
Dynamic Programming
Asymptotic Analysis :- It is used to find the space complexity and time complexity of a problem. There are some notations are used to find it such as:-
Big-oh(o)
Big-omega(omega)
Theta(theta)
Sorting is a technique which is to arrange the numbers of characters in a particular order, it is used to re-order the element of an array either in the ascending or descending order. Some of the important sorting techniques are as follow :-
Selection Sort
Insertion Sort
Bubble Sort
Quick Sort
Merge Sort
Searching is performed on an array or in a linked list or in data structure to find a particular element in an array. Some of the important topics of searching:-
Linear Search
Binary Search
Randomized algorithms, General Recursion, to find the recurrence relation of the problem.
Backtracking performs on the tree like approach. Problem is divided into the tree structure and back track to generate the result of that problem.
In Divide and Conquer, first a large problem is divided into many small problems and solve that small problem and results of all small problems are added together to get the final result of that problem.
Greedy Algorithm topics are job sequencing, Knapsack, Optimal merge pattern, Huffman coding, Dijkstra algorithm and MST.
Dynamic Programming :- It is an approach to solve a problem, it stores the current result of the problem and starts to find the next solution and adds in the result . Some of the topics are as follow:-
All pairs shortest path, multistage graph, Optimal binary search, TSP, 0/1 Knapsack, Matrix Chain.
For the theory questions are asked from the engineering core subjects. You must have knowledge about the basics of your core subjects. Core subjects like Computer networking, Database Management System, Operating system, System design and Testing.
All the topics are mentioned in the post. These topics are important for both On-Campus or Off-Campus placement. Majority of the product based companies ask questions on the topics.
In multiple job interviews, questions from data structure and basic algorithmic. But for the service based company, if you have command only on the data structure then it is ok.
Comments
Post a Comment