Posts

Showing posts from April, 2021

STRUKTUR DATA : Implementasi Linked List Java

 Program Sederhana Implementasi Single Linked List Output : Sumber Algoritma : https://github.com/milstrike/UNYDeveloperNetwork/tree/master/JavaLinkedList

STRUKTUR DATA : Tugas Mengubah Infix ke Postfix

Image
Konversi Infix ke Postfix

STRUKTUR DATA : Stack dan Implementasi Stack

Image
STACK Stack merupakan salah satu teknik dalam struktur data yang cukup mudah dipahami. Karakteristik penting stack adalah bersifat LIFO ( Last In First Out) artinya data yang terakhir masuk merupakan data yang akan keluar terlebih dahulu. METODE PADA IMPLEMENTASI STACK Push : Memasukkan data ke dalam Stack. Pop : Mengeluarkan data teratas dari Stack. Peek :  Melihat data yang berada di posisi paling atas. Count : Mengetahui jumlah isi data pada Stack. Clear : Menghapus seluruh data yang ada pada Stack. IMPLEMENTASI STACK Output :

DATA STRUCTURE : Sorting

Image
Bubble Sort The bubble sort algorithm works by repeatedly swapping adjacent elements that are not in order until the whole list of items is in sequence. Items can be seen as bubbling up the list according to their key values. Advantage Bubble sort is easy to implement. Elements are swapped in place without using additional temporary storage, so the space requirement is at a minimum. Disadvantage Bubble sort doesn't deal well with a list containing a huge number of items. This is because the bubble sort requires n-squared processing steps for every n number of elements to be sorted. Output :  Selection Sort The selection sort works by repeatedly going through the list of items, each time selecting an item according to its ordering and placing it in the correct position in the sequence. Advantage The main advantage of the selection sort is that it performs well on a small list. Because it is an in-place sorting algorithm, no additional temporary storage is required beyond what is nee...