Posts

First Journal

Bubble Sort

Posted 2025-11-16 | *By : Cuneyt Yildirim *# Bubble Sort

Problem Statement

Given an unsorted array of n elements, write a function to sort the array

Approach

  • select the first element of the array
  • compare it with its next element
  • if it is larger than the next element then swap them
  • else …

First Journal

Counting Sort

Posted 2025-11-16 | *By : Cuneyt Yildirim *# Counting Sort

Problem Statement

Given an unsorted array of n elements, write a function to sort the array.

Approach

  • Find out the maximum element (let’s call it max) from the given array.
  • Initialize an array of length max+1 with all …

First Journal

Heap Sort

Posted 2025-11-16 | *By : Cuneyt Yildirim *# Heap Sort

Problem Statement

Given an unsorted array of n elements, write a function to sort the array

Approach

  • Build a max heap from the input data.
  • At this point, the largest item is stored at the root of the heap. Replace it with the last …