Archive

Posts Tagged ‘queue’

Implementation of breadth-first search algorithm in graphs.

March 31, 2011 Leave a comment

The following function is applied onto a graph and it specifically implements the method of breadth-first search. To visit all nodes connected to node k of a graph, we put the k in a FIFO queue and then go into a loop, during which we get the next node from the queue and, if we have not already visited it, we visit it and push into the queue all nodes belonging to the adjacency list of this node, continuing this process until we empty the queue.

Read more…

Implementation of algorithms (without recursion) for preorder & level-order traversal of binary trees.

March 31, 2011 Leave a comment

The iterative (non-recursive) function preorderTreeTraverse() can perform preorder traversing of a binary tree with the help of a stack that can hold pointers to nodes of the tree.

Also, the iterative (non-recursive) function layerTreeTraverse() can perform level-order traversing of a binary tree with the help of a queue that can hold pointers to nodes of the tree.

Read more…

Arduino: A library for implementing a generic, dynamic queue (array version).

September 29, 2010 2 comments

This project refers to an Arduino library implementing a generic, dynamic queue (array version).

The data structure is implemented as a class in C++.

For more information, you can get the project itself ‘QueueArray‘.

Arduino: A library for implementing a generic, dynamic queue (linked list version).

September 28, 2010 Leave a comment

This project refers to an Arduino library for implementing a generic, dynamic queue (linked list version).

The data structure is implemented as a class in C++.

For more information, you can get the project itself ‘QueueList‘.