Mehmet Karataş LogoMehmet Karataş
HomeServicesProjectsBlogAboutFunToolsCourses (TR)
Contact
Mehmet Karataş LogoMehmet Karataş

Contact

I build solutions with modern web and mobile technologies.

Contact
benmuhendisiniz@gmail.com

Diyarbakır, Türkiye — Remote services across Türkiye and abroad

Quick links

  • Home
  • Services
  • Projects
  • Blog
  • About
  • Contact
  • Fun
  • Tools
  • Courses (TR)
  • CV / Résumé (TR)

Services

  • Web Development
  • Mobile App Development
  • Custom Software Development
  • E-Commerce Websites
  • SEO and Online Visibility
  • Software and Project Consulting

© 2026 Mehmet Karataş. All rights reserved.

Privacy noticeCookie policy
HomeProjectsBlogServicesAboutFunToolsCourses (TR)
Algoritma atölyesi

SORTING / İNTERAKTİF DENEY

Heap Sort

Organises the array into a max heap. It moves the largest element to the end, repairs the remaining heap and repeats. Follow the root and child comparisons in the bars.

Ortalama O(n log n)
Bubble SortQuick SortMerge SortSelection SortInsertion SortHeap SortBinary SearchLinear Search
Deney hazır
STEP 0 / 98
Comparisons00
Swaps00
Writes00
64
0
22
1
81
2
39
3
15
4
73
5
48
6
92
7
31
8
56
9
10
10
67
11
Comparisons Moves Root / candidate Sorted
Hazır

The array is ready. Start the first step.

Sıfırlama, aynı diziyi başlangıç durumuna getirir.

KODUN AKIŞI

Şu anda ne oluyor?

  1. 01Build a max heap from the array
  2. 02Compare the root with its children
  3. 03Move the larger child up and continue down the heap
  4. 04Move the root to the end, shrink the heap and restore it

MALİYET ANALİZİ

Algorithm properties

Best case
O(n)
Ortalama
O(n log n)
Worst case
O(n log n)
Extra space
O(1)
Kararlı sıralama
Hayır

This implementation restores the heap iteratively. If all values are equal, heap repair stops early, giving a best-case running time of O(n). Karmaşıklıklar algoritmaya aittir; görselleştirme geçmişi ek bellek kullanır.