Posts

First Journal

Insertion Sort

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

Problem Statement

Given an array of n elements, write a function to sort the array in increasing order.

Approach

  • Define a “key” index, the subarray to the left of which is sorted.
  • Initiate “key” as …

First Journal

Merge Sort

Posted 2025-11-16 | *By : Cuneyt Yildirim *# Merge Sort (Divide and Conquer Algorithm)

Problem Statement

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

Approach

  • Find a mid point and divide the array into to halves based on the mid point
  • Recursively call the merge sort …

First Journal

Quick Sort

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

Problem Statement

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

Approach

  • Make the right-most index value pivot
  • partition the array using pivot value
  • quicksort left partition recursively
  • quicksort right …