Geeks by Geeks - Algorithms Flashcards

1
Q

What are Algorithms?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Algorithm Definition

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Need for Algorithms?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the analysis of Algorithms?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Mathematical Agorithms?

https://www.geeksforgeeks.org/mathematical-algorithms-difficulty-wise/

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Bitwise Algorithms?

https://www.geeksforgeeks.org/bitwise-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Searching Algorithms

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Sorting Algorithms

https://www.geeksforgeeks.org/sorting-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Recursion?

https://www.geeksforgeeks.org/recursion-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Backtracking Algorithm?

https://www.geeksforgeeks.org/backtracking-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is 8. Divide and Conquer Algorithm?

http://geeksforgeeks.org/divide-and-conquer/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Greedy Algorithm?

https://www.geeksforgeeks.org/greedy-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is dynamic programning?

https://www.geeksforgeeks.org/dynamic-programming/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are Graph Algorithms

https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Pattern Searching?

https://www.geeksforgeeks.org/pattern-searching/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the Branch and Bound Algorithm?

https://www.geeksforgeeks.org/branch-and-bound-algorithm/

A

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.

15
Q

What are Geometric Algorithms?

http://geeksforgeeks.org/geometric-algorithms/

A

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

16
Q

What are Randomized Algorithms

https://www.geeksforgeeks.org/randomized-algorithms/

A

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.