Data structures are used by computers as the containers within which
information is stored. Different data structures exist, and some are better
suited to different types of data than others. When storing data, a
programmer must decide which of the data structures available is the best
to use.
An array is an indexed set of related elements. 2d= Array Maze = { {Wall,
Path, Wall}, {Path, Path, Wall}, {Wall, Path, Wall}}
Abstract data structures don’t exist as data structures, instead they make
use of other data structures such as arrays to form a new way of storing
data.
A queue is an abstract data structure based on an array. Just like a
queue at a bus stop, the first item added to a queue is the first to be
removed. Because of this, queues are referred to as “first in, first
out” (or FIFO) abstract data structures. Queues are used by
computers in keyboard buffers, where each keypress is added to the
queue and then removed when the computer has processed the
keypress. This ensures that letters appear on the screen in the same
order that they were typed. The breadth first search algorithm uses
a queue to keep track of which nodes in a network have been
visited.
A linear queue has two pointers, a front pointer and a rear pointer.
These can be used to identify where to place a new item in a queue
or to identify which item is at the front of the queue.
A circular queue is a type of queue in which the front and rear
pointers can move over the two ends of the queue, making for a
more memory efficient data structure.