📊🔍 Unraveling Data Enigmas with a Curious Mind 🕵️♂️ | Turning Numbers into Narratives 📈📖 | Exploring the Digital Wilderness for Insights 🌐🌄 | Plotting Trends and Painting Possibilities 🎨📊 | Making Sense of the Puzzle, One Data Point at a Time 🧩🔓 #InsightsSeeker 🚀
Circular Singly Linked List
Dapatkan link
Facebook
X
Pinterest
Email
Aplikasi Lainnya
-
# Represents the node of list.class Node:
def __init__(self, data):
self.data = data;
self.next = None;
class CreateList:
# Declaring head and tail pointer as null.def __init__(self):
self.head = Node(None);
self.tail = Node(None);
self.head.next = self.tail;
self.tail.next = self.head;
# This function will add the new node at the end of the list.def add(self, data):
newNode = Node(data);
# Checks if the list is empty.if self.head.data is None:
# If list is empty, both head and tail would point to new node.self.head = newNode;
self.tail = newNode;
newNode.next = self.head;
else:
# tail will point to new node.self.tail.next = newNode;
# New node will become new tail.self.tail = newNode;
# Since, it is circular linked list tail will point to head.self.tail.next = self.head;
# Displays all the nodes in the listdef display(self):
current = self.head;
if self.head is None:
print("List is empty");
return;
else:
print("Nodes of the circular linked list: ");
# Prints each node by incrementing pointer.print(current.data), while (current.next != self.head):
current = current.next;
print(current.data),class CircularLinkedList:
cl = CreateList();
# Adds data to the listcl.add(1);
cl.add(2);
cl.add(3);
cl.add(4);
# Displays all the nodes present in the listcl.display();1
Yeeeeyy , akhirnya saya telah selesai mengikuti ujian. 😇😇😇😇 Saya melakukan tes TOEFL IBT pada tanggal 25 maret 2017 lalu, saya mendaftar tes satu bulan sebelumnya. Bodohnya,saya masih santai-santai lalu saya baru sadar kalau tes tersebut merupakan tes tersusah (menurut saya, karena sesi speaking itu berhadapan dengan komputer yaaa yang seperti kita tahu kalau komputer tidak ada seprti manusia jadi yaa bener engganya sudah di programkan , kalau sama manusia kan masih bisa kompromi atau kode-kode gimana gitu kan:D). Saya berharap dalam waktu dua minggu tersebut saya mempunyai banyak waktu untuk belajar , namun kenyataannya TIDAK SAMA SEKALI. Saya disibukan dengan berbagai macam acara , mulai dari pernikahan teman MAN saya , kemudian disusul dengan acara-acara lain. Disaat itulah saya sangat MENYESAL dengan waktu yang telah saya foya-foya kan. Ketika kelas 3 MAN saya mengikuti kelas bimbingan belajar TOEFL yang diadakan ...
alhamdulillah akhirya masuknya di 81 .. seneng horreeeee .. :) menurut aku sih kelas 2 itu bagaikan raja , karena di saat kelas 2 itu disitulah banyak konflik yg terjadi kaya masa-masa kerjaan gituu , hihihihi (maaf ya abis aku lebih suka cerita history), kelas satu itu junior dan masih malu-malu , dan kelas 3 sudah harus fokus sama ujian jadi mereka ga terlalu banyak ikut campur aktifitas sekolah , jadi kelas 2 lah yang menguasai sekolah .. dan yang biasa nge judge adalah anak-anak kelas 2 ,, waktu awal-awal kelas 2 sih menurutku aman-aman saja , namun ketika aku dicalonkan menjadi ketua osis , itu membuatku takut , tahu ga sih mereka itu tuh kerjaan yg menurutku berat namun apadaya .. karena ... sudahlah jangan dibahas nanti ada masalah .. dan akhirnya aku terpilih menjadi wakil ketua osis ,, dan aku sangat bersyukur namun hari-hari yg kujalani sangat berat .. dan aku pernah menangis karena masalah osis .. aku sering menangis karena masalah osis , itu mebuatku takut dan ben...
Komentar
Posting Komentar