-
Notifications
You must be signed in to change notification settings - Fork 43
Module 1 (Practice)
-
Modify the stack data structure to allow finding the smallest element with O(1) complexity.
-
A TC Clinic is currently serving a queue of patients. Every patient has an id and an urgency level that are represented by a number. Make a program to simulate how the queue goes on that clinic!
The first line is Q, the amount of queries. Every query can consist of:
-
MASUK id x- id is the id of a patient and x is the level of urgency. -
LAYANI- print the id of the patient that is currently being attended to.
For every
LAYANIquery, print the id of the patient that is currently being attended to. If there are no more patients in queue, print "HORE".Input Example
9 MASUK 1 15 MASUK 3 2 MASUK 2 6 MASUK 7 15 LAYANI LAYANI MASUK 8 100 LAYANI LAYANI
Output Example
1 7 8 2
-
-
Modify the given Stack, Queue, Deque, and Priority Queue so that they can store a string with maximum of 100 characters.
Modul Struktur Data
Ditulis oleh tim Asisten Struktur Data 2020 - Teknik Informatika ITS
Modul 0
- Pengenalan Struktur Data IND | ENG
- Dynamic Array IND | ENG
- Linked List IND | ENG
- Soal Latihan IND | ENG
Modul 1
- Stack IND | ENG
- Queue IND | ENG
- Deque IND | ENG
- Priority Queue (List Based) IND | ENG
- Soal Latihan IND | ENG
Modul 2
- Pengenalan Tree IND | ENG
- Binary Search Tree IND | ENG
- Traversal BST IND | ENG
- Soal Latihan IND | ENG
Modul 3
Modul 4
- Melangkah Menuju C++ | ENG
- Standard Template Library Container | ENG
- Pengenalan Graf | ENG
- Traversal Graf | ENG
Modul 5