Matsushita's Blog


キューを使って2分木をレベル毎に探索する BST Level-Order Traversal in Hacker Rank

問題 2分木が与えられ、深さ順に探索する問題。 ソースコード

Implement a Queue by using two Stacks

Problem Implement a MyQueue class which implements a queue using two stacks Source Code

Implementation of Queue with LinkedList in Java

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: is the position to enqueue at next time

Implementation of "Ring Buffer" in Java

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…

281. Zigzag Iterator : Past Google Coding Interview

Problem 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…