Sorting algorithms

In computer science a sorting algorithm is an algorithm that puts elements of a list in a certain order

Bubble Sort

`BUBBLESORT(A)1 for i = 1 to A.length - 12     for j = A.length downto i + 13         if A[j] < A[j - 1]4             exchange A[j] with A[j - 1]`

Get the C program below on my GitHub:

Selection Sort

Get the code for selection sort from my GitHub below:

Merge Sort

Conceptually, a merge sort works as follows:
1)Divide the unsorted list into n sublists, each containing 1 element (a list of 1 element is considered sorted).
2)Repeatedly merge sublists to produce new sorted sublists until there is only 1 sublist remaining. This will be the sorted list.

Search Algorithms

Binary Search

`binary_search(A, target):   lo = 1, hi = size(A)   while lo <= hi:      mid = lo + (hi-lo)/2      if A[mid] == target:         return mid                  else if A[mid] < target:          lo = mid+1      else:         hi = mid-1               // target was not found`

Data Structures

In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

Tree Data Structure

So basically a heap is a special tree which is a special graph data structure.

Thanks for reading this article I hope its helpful to you all ! Keep up the learning, and if you would like more computer science and algorithm analysis videos please visit and subscribe to my YouTube channels (randerson112358 & compsci112358 )

Check Out the following for content / videos on Computer Science, Algorithm Analysis, Programming and Logic:

compsci112358:

Video Tutorials on Recurrence Relation:

Video Tutorial on Algorithm Analysis:
https://www.udemy.com/algorithm-analysis/

Written by