Queue
問題 2分木が与えられ、深さ順に探索する問題。 www.hackerrank.com ソースコード
Problem Implement a MyQueue class which implements a queue using two stacks Source Code
Implement Queue with LinkedList I defined a Queue class with the following two property, first and last. first: first it the position to dequeue at next time last: last.next is the position to enqueue at next time
What's "Ring Buffer" Ring Buffer is basically like Queue. The difference between Ring Buffer and normal Queue is that Ring Buffer is circular data structure. So, if tail and head index reach the index of max size, they are reseted zero. Th…
Problem https://leetcode.com/problems/zigzag-iterator/ How to Solve By using Iterator and Queue, I can solve this problem. Iterator ListIterator (Java Platform SE 8 ) An iterator for lists that allows the programmer to traverse the list in…