Praktikum Linked List
Praktikum Linked List
Introduction to
Java Programming
for High School
< Here is where your presentation begins >
... }
Our team
{ ..
*
Siti safhira Ridwan Taufik
.. }
Pengertian linked list
Salah satu bentuk struktur data yang berisi kumpulan data yang tersusun secara sekuensial, saling
bersambungan, dinamis dan terbatas adalah senarai berkait (linked list). Suatu senarai berkait (linked
list) adalah suatu simpul (node) yang dikaitkan dengan simpul yang lain dalam suatu urutan tertentu.
Suatu simpul dapat berbentuk suatu struktur atau class.
Simpul harus mempunyai satu atau lebih elemen struktur atau class yang berisi data. Secara teori, linked
list adalah sejumlah node yang dihubungkan secara linier dengan bantuan pointer.
Senarai berkait lebih efisien di dalam melaksanakan penyisipan-penyisipan dan penghapusan-
penghapusan. Senarai berkait juga menggunakan alokasi penyimpanan secara dinamis, yang merupakan
penyimpanan yang dialokasikan pada runtime.
Pengertian linked list
Dalam menghubungkan setiap node, kita dapat menggunakan cara first-create-first-access ataupun
first-create-lastaccess. Yang berbeda dengan deklarasi struct sebelumnya adalah satu field bernama
next, yang bertipe struct tnode. Hal ini sekilas dapat membingungkan. Namun, satu hal yang jelas,
variabel next ini akan menghubungkan kita dengan node di sebelah kita, yang juga bertipe struct
tnode. Hal inilah yang menyebabkan next harus bertipe struct tnode.
Karena di dalam banyak aplikasi, ukuran dari data itu tidak diketahui pada saat kompile, hal ini bisa
merupakan suatu atribut yang baik juga. Setiap node akan berbentuk struct dan memiliki satu buah
field bertipe struct yang sama, yang berfungsi sebagai pointer.
Bentuk Umum :
typedeft struct telemtlist
{
infotype info;
address next;
}elmtlist;
infotype -> sebuah tipe terdefinisi yang menyimpan informasi sebuah elemen list
next -> address dari elemen berikutnya (suksesor). Jika L adalah list, dan P adalah address, maka
alamat elemen pertama list L dapat diacu dengan notasi : first (L)
Sebelum digunakan harus dideklarasikan terlebih dahulu :
#define First(L) (L)
Elemen yang diacu oleh P dapat dikonsultasi informasinya dengan notasi :
info(P)deklarasi #define info(P) P->info
next(P)deklarasi #define next(P) P->next
Beberapa Definisi:
Insert IsEmpty
Istilah Insert berarti menambahkan Fungsi ini menentukan apakah
sebuah simpul baru ke dalam suatu linked list kosong atau tidak.
linked list.
Retrieve Update
Fungsi ini mengambil elemen yang Fungsi ini mengubah elemen
ditunjuk oleh now. Elemen tersebut yang ditunjuk oleh now dengan
lalu dikembalikan oleh fungsi. isi dari sesuatu.
Clear
Fungsi ini menghapus linked list yang sudah ada. Fungsi ini
wajib dilakukan bila anda ingin mengakhiri program yang
menggunakan linked list. Jika anda melakukannya, data-data
yang dialokasikan ke memori pada program sebelumnya akan
tetap tertinggal di dalam memori.
Jenis-jenis linked }
list!
1. Single Linked List (Senarai berkait tunggal)
1) Single Linked List non Circular
2) Single Linked List Circular
2. Double Linked List (Senarai berkait ganda)
1) Double Linked List non Circular
2) Double Linked List Circular
}
Single Linked List (senarai berkait
tunggal)
{ Single linked list adalah apabila hanya ada satu pointer yang menghubungkan setiap node (satu arah “next”).
}
Single Linked List (senarai berkait
tunggal)
{ Single Linked List Circular
SLLC adalah Single Linked List yang pointer nextnya menunjuk pada dirinya sendiri. Jika Single Linked List
tersebut terdiri dari beberapa node, maka pointer next pada node terakhir akan menunjuk ke node terdepannya.
Pengertian:
Single : artinya field pointer-nya hanya satu buah saja dan satuarah.Linked List : artinya node-node tersebut
saling terhubung satusama lain.
Circular : artinya pointer next-nya akan menunjuk pada dirinyasendiri sehingga berputar
}
DATA Pointer
}
Pointer Pointer
Data
null Prev next null
}
Pointer Pointer
Data
Prev next
} ..
Do you need longer text?
Mercury is the closest planet to the Sun and the Mercury takes a little more than 58 days to
smallest one in the entire Solar System. This complete its rotation, so try to imagine how
planet's name has nothing to do with the liquid long days must be there! Since the
metal, since Mercury was named after the temperatures are so extreme, albeit not as
Roman messenger god. It isn’t as hot as Venus, extreme as on Venus, Mercury has been
for instance deemed to be non-habitable for humans
{ ..
The slide title goes here!
*
Do you know what helps you make your point crystal clear? Lists
like this one:
● They’re simple
● You can organize your ideas clearly
● You’ll never forget to buy milk!
And the most important thing: the audience won’t miss the point
of your presentation
You can divide the content
{ Mercury Venus
Mercury is the closest planet to the Venus has a beautiful name and is
Sun and the smallest one in the the second planet from the Sun. It’s
}
Solar System—it’s only a bit larger hot and has a poisonous atmosphere
than the Moon
Here are three ideas
Mercury
...
Mercury is the closest planet
to the Sun and the smallest of Venus
them all
Venus has a beautiful name Mars
and is the second planet from
the Sun Despite being red, Mars is
actually a cold place. It’s full
of iron oxide
Practical exercise 01
Write a Java program to print 'Hello' on screen and then print your
name on a separate line.
Expected output:
Hello
Sofia Hill
Here are four concepts
Mars Venus
Despite being red, Mars Venus has a nice name
is a cold place and a very toxic
atmosphere
Jupiter Saturn
Jupiter is the biggest Saturn is a gas giant and
planet of them all has several rings
{ .. Here are six concepts
Mars Venus Neptune
Despite being red, Mars Venus has a nice name Neptune is the farthest
is a cold place and a very toxic planet from the Sun
atmosphere
} ..
Practical exercise 02
Write a Java program to divide two numbers and print on the
screen.
Test data:
80/2
Expected output:
40
} ..
{ ..
Awesome
words
} ..
Practical exercise 03
Write a Java program that takes two numbers as input and
displays the product of two numbers.
Test data:
Input first number: 70
Input second number: 4
Expected output:
70 x 4 = 280
{ ..
—Someone Famous
} ..
A picture is worth a thousand words
A picture
always
reinforces
the concept
Images reveal large amounts of data, so
remember: use an image instead of a
long text. Your audience will appreciate
it
Practical exercise 04
Write a Java program to print the sum (addition), multiplication,
subtraction, division and remainder of two numbers.
Test data:
Input first number: 200
Input second number: 55
Expected Output:
200 + 55 = 255
200 - 55 = 145
200 x 55 = 11000
200 / 55 = 3,63
} ..
200 mod 5 = 35
{
98,300,000
< Big numbers catch your audience’s attention >
}
9h 55m 23s
Jupiter’s rotation period
333,000
The Sun’s mass compared to Earth’s
386,000 km
Distance between Earth and the Moon
Let’s use some percentages
Input data:
Expected output:
Hexadecimal value: D
{ Computer
mockup
You can replace the image on the screen
with your own work. Just right-click on it
and select “Replace image”
... }
{ Tablet mockup
You can replace the image on the screen with
your own work. Just right-click on it and select
“Replace image”
}
{
Phone mockup
You can replace the image on the screen
with your own work. Just right-click on it
and select “Replace image”
... }
{ .. This is a map
Venus
Venus is the second planet
from the Sun
Mercury
Mercury is the closest
planet to the Sun
Mars
Despite being red, Mars is
.. }
a very cold place
A timeline always works well
*
{ Venus is the second planet
from the Sun
Despite being red, Mars is
a very cold place
}
planet to the Sun planet of them all
Infographics are useful
{ .. Mars Venus
Mars is a Venus is a
red planet Solar System hot planet
Mercury Jupiter
Mercury is Jupiter is a
very small gas giant
} ..
Practical exercise 06
Write a Java program to check whether Java is installed on your
computer.
Expected output:
}
You can use this graph
Mercury
Mercury is the smallest
planet
Venus
Venus has very high
temperatures
*
Jupiter Saturn
Jupiter is the biggest Saturn is a gas giant with
planet rings
Follow the link in the graph to modify its data and then paste the new one here. For more info, click here
Practical exercise 07
Input data:
Expected output:
Photos
● Html and css collage concept with person I
● Html and css collage concept with person II
● Html and css collage concept with person III
● Html and css collage concept with person IV
● Medium shot smiley woman at library
● Medium shot man holding notebook
Instructions for use
If you have a free account, in order to use this template, you must credit Slidesgo by keeping the Thanks slide. Please
refer to the next slide to read the instructions for premium users.
For more information about editing slides, please read our FAQs or visit our blog:
https://slidesgo.com/faqs and https://slidesgo.com/slidesgo-school
Instructions for use (premium users)
As a Premium user, you can use this template without attributing Slidesgo or keeping the Thanks slide.
For more information about editing slides, please read our FAQs or visit our blog:
https://slidesgo.com/faqs and https://slidesgo.com/slidesgo-school
Fonts & colors used
This presentation has been made using the following fonts:
PHASE 1
Task 1
Task 2
PHASE 2
Task 1
Task 2
PHASE 1
Task 1
Task 2
...and our sets of editable icons
You can resize these icons without losing quality.
You can change the stroke and fill color; just select the icon and click on the paint bucket/pen.
In Google Slides, you can also use Flaticon’s extension, allowing you to customize and add even more icons.
Educational Icons Medical Icons
Business Icons Teamwork Icons
Help & Support Icons Avatar Icons
Creative Process Icons Performing Arts Icons
Nature Icons
SEO & Marketing Icons