Algorithms


An algorithm is a procedure used for solving a problem or performing a computation. Algorithms act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines.

Searching
There are various algorithms available. One of the basic and most used algorithm is the searching algorithm. Searching algorithms are used to find a specific element in an array, string, linked list, or some other data structures. The most common searching algorithms include: Sorting
Sorting algorithm is used to rearrange a given array or list elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of element in the respective data structure. There are many different types of sorting algorithms like bubble sort, selection sort, insertion sort, quick sort, and merge sort.


Divide and Conquer
As the name suggests, it breaks the problem into parts, then solves each part and after that again merges the solved subtasks to get the actual problem solved. This is the primary technique mentioned in the two sorting algorithms, quick sort and merge sort. A typical divide and conquer algorithm solves a problem using the following three steps:
  1. Divide, which break the given problem into subproblems of same type,
  2. Conquer, which recursively solve these subproblems, and
  3. Combine, which appropriately combine the answers.

Review: Sorting Algorithms
    What kind of sorting algorithm does not exist?

      Bubble sort
      Greedy sort
      Merge sort
      Quick sort
Result:        




      One day... I’m gonna make the onions cry.