Geeks by Geeks - Algorithms Flashcards
What are Algorithms?
Algorithm is a step-by-step procedure for solving a problem or accomplishing a task. In the context of data structures and algorithms, it is a set of well-defined instructions for performing a specific computational task.
Algorithms are fundamental to computer science and play a very important role in designing efficient solutions for various problems. Understanding algorithms is essential for anyone interested in mastering data structures and algorithms.
Algorithm Definition
An algorithm is a finite sequence of well-defined instructions that can be used to solve a computational problem. It provides a step-by-step procedure that convert an input into a desired output.
Algorithms typically follow a logical structure:
Input: The algorithm receives input data.
Processing: The algorithm performs a series of operations on the input data.
Output: The algorithm produces the desired output.
What is the Need for Algorithms?
Algorithms are essential for solving complex computational problems efficiently and effectively. They provide a systematic approach to:
Solving problems: Algorithms break down problems into smaller, manageable steps.
Optimizing solutions: Algorithms find the best or near-optimal solutions to problems.
Automating tasks: Algorithms can automate repetitive or complex tasks, saving time and effort.
What is the analysis of Algorithms?
Analysis of Algorithms is the process of evaluating the efficiency of algorithms, focusing mainly on the time and space complexity.
This helps in evaluating how the algorithm’s running time or space requirements grow as the size of input increases.
What are Mathematical Agorithms?
https://www.geeksforgeeks.org/mathematical-algorithms-difficulty-wise/
Mathematical algorithms are used for analyzing and optimizing data structures and algorithms. Knowing basic concepts like divisibility, LCM, GCD, etc.
can really help you understand how data structures work and improve your ability to design efficient algorithms.
What are Bitwise Algorithms?
https://www.geeksforgeeks.org/bitwise-algorithms/
Bitwise algos are algos that operate on individual bits of Numbers.
These algos manipultae the binaruy representation of numbers like shifting bits, settings or clearing specific bits of a number and perform bitwise operations (AND , OR XOR).
Bitwise algorithms are commonly used in low level programming, cryptography and optimization tasks where efficient manipulation or individual bits is required.
https://www.geeksforgeeks.org/explore?page=1&category=Bit%20Magic&sortBy=submissions
What are Searching Algorithms
Searching Algorithms are used to find a specific element or item in a collection of data. These algorithms are widely used to retrieve data efficiently from large datasets.
https://www.geeksforgeeks.org/explore?page=1&category=Searching&sortBy=submissions
What is Sorting Algorithms
https://www.geeksforgeeks.org/sorting-algorithms/
Sorting algorithms are used to arrange the elements of a list in a specific order, such as numerical or alphabetical.
It organizes the items in a systematic way, making it easier to search for and access specific elements.
https://www.geeksforgeeks.org/explore?page=1&category[]=Sorting
What is Recursion?
https://www.geeksforgeeks.org/recursion-algorithms/
Recursion is a programming technique where a function calls itself within its own definition.
It is usually used to solve problems that can be broken down into smaller instances of the same problem.
https://www.geeksforgeeks.org/explore?page=1&category[]=Recursion
What is Backtracking Algorithm?
https://www.geeksforgeeks.org/backtracking-algorithms/
Backtracking Algorithm is derived from the Recursion algorithm, with the option to revert if a recursive solution fails, i.e. in case a solution fails, the program traces back to the moment where it failed and builds on another solution.
So basically it tries out all the possible solutions and finds the correct one.
https://www.geeksforgeeks.org/explore?page=1&category=Backtracking&sortBy=submissions
What is 8. Divide and Conquer Algorithm?
http://geeksforgeeks.org/divide-and-conquer/
Divide and conquer algorithms follow a recursive strategy to solve problems by dividing them into smaller subproblems, solving those subproblems, and combining the solutions to obtain the final solution.
https://www.geeksforgeeks.org/explore?page=1&category=Divide%20and%20Conquer&sortBy=submissions
What is Greedy Algorithm?
https://www.geeksforgeeks.org/greedy-algorithms/
Greedy Algorithm builds up the solution one piece at a time and chooses the next piece which gives the most obvious and immediate benefit i.e., which is the most optimal choice at that moment.
So the problems where choosing locally optimal also leads to the global solutions are best fit for Greedy.
https://www.geeksforgeeks.org/explore?page=1&category[]=Greedy
What is dynamic programning?
https://www.geeksforgeeks.org/dynamic-programming/
Dynamic Programming is a method used to solve complex problems by breaking them down into simpler subproblems. By solving each subproblem only once and storing the results, it avoids redundant computations, leading to more efficient solutions for a wide range of problems.
https://www.geeksforgeeks.org/explore?page=1&category[]=Dynamic%20Programming
What are Graph Algorithms
https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/
Graph algorithms are a set of techniques and methods used to solve problems related to graphs, which are a collection of nodes and edges. These algorithms perform various operations on graphs, such as searching, traversing, finding the shortest path, and determining connectivity.
They are essential for solving a wide range of real-world problems, including network routing, social network analysis, and resource allocation.
https://www.geeksforgeeks.org/explore?page=1&category=Graph&sortBy=submissions
What is Pattern Searching?
https://www.geeksforgeeks.org/pattern-searching/
Pattern Searching is a fundamental technique in DSA used to find occurrences of a specific pattern within a larger text.
The Pattern Searching Algorithms use techniques like preprocessing to minimize unnecessary comparisons, making the search faster.
https://www.geeksforgeeks.org/explore?page=1&category=Pattern%20Searching&sortBy=submissions
What is the Branch and Bound Algorithm?
https://www.geeksforgeeks.org/branch-and-bound-algorithm/
Branch and Bound Algorithm is a method used in combinatorial optimization problems to systematically search for the best solution. It works by dividing the problem into smaller subproblems, or branches, and then eliminating certain branches based on bounds on the optimal solution.
This process continues until the best solution is found or all branches have been explored.
What are Geometric Algorithms?
http://geeksforgeeks.org/geometric-algorithms/
Geometric algorithms are a set of algorithms that solve problems related to shapes, points, lines and polygons.
Geometric algorithms are essential for solving a wide range of problems in computer science, such as intersection detection, convex hull computation, etc.
https://www.geeksforgeeks.org/explore?page=1&category=Geometric&sortBy=submissions
What are Randomized Algorithms
https://www.geeksforgeeks.org/randomized-algorithms/
Randomized algorithms are algorithms that use randomness to solve problems. They make use of random input to achieve their goals, often leading to simpler and more efficient solutions.
These algorithms may not product same result but are particularly useful in situations when a probabilistic approach is acceptable.