Antrian Kotlin
import java.util.LinkedList
fun main() {
val queueA = LinkedList<Int>()
queueA.add(1)
queueA.add(2)
print(queueA.poll())
}
Shy Stork
import java.util.LinkedList
fun main() {
val queueA = LinkedList<Int>()
queueA.add(1)
queueA.add(2)
print(queueA.poll())
}
val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni", "Bob", "Chris", "David", "Emily"))
println(studentQueue)
studentQueue.add("Felix")
println(studentQueue)
val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni"))
val element = studentQueue.element()
println(element + " : " + studentQueue)
studentQueue.remove()
val studentQueue: Queue<String> = LinkedList<String>(mutableListOf("Agni"))
val removedElement = studentQueue.remove()
println(removedElement + " : " + studentQueue)