User Tools

Site Tools


opus:fall2012:eolson1:datapart2

data Keyword 2

stack overflow condition

Definition

A stack overflow is when to much memory is used when creating a stack. when a stack is created it uses something called a push which is basically the append function in a linked list. The push will “Push” something on the stack. similar to a stack of papers the “push” puts a paper on the top of the stack. A stack overflow is when you put to many papers on the stack.

References

data Keyword 2 Phase 2

! queue data structure !!!!

Definition

Queue Data Structure

Queue is a specialized data storage structure (Abstract data type). Unlike, arrays access of elements in a Queue is restricted. It has two main operations enqueue and dequeue. Insertion in a queue is done using enqueue function and removal from a queue is done using dequeue function. An item can be inserted at the end (‘rear’) of the queue and removed from the front (‘front’) of the queue. It is therefore, also called First-In-First-Out (FIFO) list. Queue has five properties - capacity stands for the maximum number of elements Queue can hold, size stands for the current size of the Queue, elements is the array of elements, front is the index of first element (the index at which we remove the element) and rear is the index of last element (the index at which we insert the element).

Queue is a data structure that maintain “First In First Out” (FIFO) order. And can be viewed as people queueing up to buy a ticket. In programming, queue is usually used as a data structure for BFS (Breadth First Search). Queue operations

Operations on queue Q are :

1. enqueue - insert item at the back of queue Q 2. dequeue - return (and virtually remove) the front item from queue Q 3. init - intialize queue Q, reset all variables.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

Demonstration

This is a basic linked list based demonstration of a queue. A queue is basically a line so first in the queue is at the “front” of the line and when you insert into the queue you insert at the end just like a line.

opus/fall2012/eolson1/datapart2.txt · Last modified: 2012/10/31 14:45 by eolson1