A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. Here is the list of some of most used data structures in computer science.
- Stack Implementation Using Array
- Array List
- Linked List
- Heap (Min/Max Heap)
What is Algorithm?
We know that a computer cannot do anything by itself. We have to program a computer. So, a program should be based on well defined solution for a specific problem. If the solution is not defined properly, we cannot expect the right response from a computer, because that computer is not properly instructedby the programmer. This step by step instructions are nothing but an algorithm.
In other words, Algorithm is a set of well defined instructions to achieve specific outcome or transform the input into the output.
Any real life problems can be solved using two steps.
- Define the problem.
- Design the algorithm ti solve that problem.
One of the challenge for any programmer is to analyse time and space complexity of the algorithm and optimize it for better performance. In below set of articles, we have tried to cover some of the algorithms with thier time and space complexity analysis.
Recursion – Backtracking
In backtracking algorithms you try to build a solution one step at a time. If at some step it becomes clear that the current path that you are on cannot lead to a solution you go back to the previous step (backtrack) and choose a different path. Briefly, once you exhaust all your options at a certain step you go back.
Think of a labyrinth or maze – how do you find a way from an entrance to an exit? Once you reach a dead end, you must backtrack. But backtrack to where? to the previous choice point. Here is the list of problems which can be solved using recursion backtracking.
Searching is a process of checking and finding an element from a list of elements. Let A be a collection of data elements and we want to search element X in collection A. The search is said to be successful, if X does appear in A and unsuccessful otherwise. There are several types of searching techniques; one has some advantages over other. Following are some of the important searching techniques.
- Linear or Sequential Searching – not recommended
- Binary Search
- Fibonacci Search
- Interpolation Search
One of the fundamental problem of computer science is ordering a list of records. Computer systems are often used to store large amount of data from which individual records must be retrieved according to some search criterian. Searching becomes much easier if these records are sorted. There are plenty of sorting algorithms available. Each one has their pros and cons.
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Shell Sort
- Radix Sort
- Radix Exchange Sort
Graph is a non linear data structure, it contains a set of points known as nodes (or vertices) and set of links known as edges which connects the vertices. The pictorial representation is shown in the image in the right pane. There are various algorithm which are based on graph data structure from which we have covered below :
We will keep adding graph related algorithms in this section, stay tuned 🙂
That's all for this topic. If you guys have any suggestions or queries, feel free to drop a comment. We would be happy to add that in our post. You can also contribute your articles by creating contributor account here.
Happy Learning 🙂