Skip to content

Conversation

nongpal
Copy link
Contributor

@nongpal nongpal commented Jul 13, 2025

Deskripsi (Description)

Mengimplementasikan algoritma bubble sorting untuk mengurutkan array yang acak menjadi urut dari elemen terkecil ke elemen terbesar di dalam array.

Checklist:

Umum:
  • Saya menambah algoritma terbaru.
  • Saya memperbaiki algoritma yang sudah ada.
  • Saya memperbaiki dokumentasi.
  • Saya menambah dokumentasi.
Contributor Requirements (Syarat Kontributor) dan Lain-Lain:
  • Saya sudah membaca (I have read) CONTRIBUTING dan sudah menyetujui semua syarat.
  • Saya telah menambahkan komentar kode yang memberikan penjelasan maksud dari kode yang saya buat.
  • Saya menggunakan bahasa Indonesia untuk memberikan penjelasan dari kode yang saya buat.

Environment

Saya menggunakan (I'm using):

  • OS = Linux
  • gcc = 15.1.1 20250425

Link Issues

Issues : #

@nongpal nongpal requested a review from slowy07 as a code owner July 13, 2025 16:22
@slowy07 slowy07 added the ready-to-merge ready to merge label Jul 14, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binary filenya jangan ikutan di push @nongpal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Baik bang, sudah saya hapus

@slowy07 slowy07 removed the ready-to-merge ready to merge label Jul 14, 2025
@yusuf601
Copy link
Contributor

void bubble_sort(int array[], int jumlah_elemen) {
  int swapped;
  do {
    swapped = 0;
    for (int i = 1; i < jumlah_elemen; i++) {
      if (array[i - 1] > array[i]) {
        tukar(&array[i - 1], &array[i]);
        swapped = 1;
      }
    }
    jumlah_elemen--; // elemen terakhir sudah di tempatnya
  } while (swapped);
}

mending gini ngk sih,codacy error soalnya

@nongpal nongpal closed this Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants