Let's Learn Algorithms - What is a queue and how do I implement one?

preview_player
Показать описание
Learn what a queue is with real world examples, and then follow along as we learn to implement a queue using Go, a programming language created by Google.

The queue created in this video has a slight memory issue that is a byproduct of slices are created in Go. If you use it long enough, chances are you will run out of memory. I still opted to use this approach because it is much easier to understand and it is fine for most programs that don't use a queue indefinitely.

Рекомендации по теме
Комментарии
Автор

I love the video because its simple and straight forward for even a learner, nice one man

rukewveofobrukweta
Автор

At the end you created the queue package. To run it it has to be executed from a main function in another file?

shleebeez
Автор

@Jon Calhoun, about generics: Would creating an Interface function that the various types(int, strings etc) can then compose from help?

komuwairagu
Автор

Too simple implementation of deque(). Start a loop in which a single element is added to and immediately removed from the queue. Keep the loop running for a while and observe how it will run out of memory.

Автор

>>NOT VALID GO CODE
Generic proposal accepted!
Hurray! *spongebob image*
(no)

АртемРозанов-ьг
welcome to shbcf.ru