Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save myavuzokumus/343bf2194f244ad7c2c3cd47d042efc0 to your computer and use it in GitHub Desktop.
Save myavuzokumus/343bf2194f244ad7c2c3cd47d042efc0 to your computer and use it in GitHub Desktop.
Birtakım Insertion & Selection Sort sıralaması
[22,27,16,2,18,6] -> Insertion Sort
Aşama 1: [16,22,27,2,18,6]
Aşama 2: [2,16,22,27,18,6]
Aşama 3: [2,16,18,22,27,6]
Aşama 4: [2,4,16,18,22,27]
Big-O bu durum için n^2'dir.
Time Complexity: Dizi sıralandıktan sonra 18 sayısı "Average case" kapsamına girer.
[7,3,5,8,2,9,4,15,6] -> Selection Sort
Aşama 1: [2,3,5,8,7,9,4,15,6]
Aşama 2: [2,3,5,8,7,9,4,15,6]
Aşama 3: [2,3,4,8,7,9,5,15,6]
Aşama 4: [2,3,4,5,7,9,8,15,6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment