Radix sort
Definition: Radix
MATHEMATICS: the base of a system of numeration.
FORMAL: a source or origin of something. "Judaism is the radix of Christianity"
Radix sort is a non-comparative integer sorting algorithm that sorts data with integer keys by
gr

Depth First traversal
There are three types of depth-first traversal: pre-order, in-order and post-order. For a binary tree,
they are defined as operations recursively at each node, starting with the root node as follows:
Pre-order
1. Visit the root.
2. T

(Using two queues)
Current level
A
Next level
B C
B C
D E F G
D E FG
H
H
Enqueue root on CurrentLevel
While currentLevel
Display currentlevel
Dequeue currentLevel
Enqueue left nextLevel
Enqueue right nextLevel
If currentlevel=NULL
Currentlevel=nextLevel
N

voidArrayTest()
cfw_
intscores[100];
/operateontheelementsofthescoresarray.
scores[0]=1;
scores[1]=2;
scores[2]=3;
The key point isthat the entire array is allocated as one block of memory.
Once the array is set up, access to any element is convenient an

Two linked lists
Write a program that reads a list of students (first names only) from a file. It is possible for the names to be in unsorted
order in the file but they have to be placed in sorted order within the linked list.
The program should use a dou

The height of a node is the length of the longest downward path to a leaf from that node. The height of
the root is the height of the tree.
The depth of a node is the length of the path to its root (i.e., its root path). This is commonly needed in
the man

Circular list
Deleting and inserting (Have to worry about out of bounds)
1) Rear and Front start at -1 (Array is empty)
2) Inserts are done at the rear(rear+), deletes are done at the front(front+)
a. If front or rear is outside the bounds, it has to be s

Expression evaluation
Postfix also known as Reverse Polish Notation (or RPN), is a notational system where the
operation/function follows the arguments. For example, "1 2 add" would be postfix notation for adding
the numbers 1 and 2.
Programming languages

Stack
stack new nodes can be added and removed only at the top
similar to a pile of dishes
last-in/first-out (LIFO)
Bottom of stack indicated by a link member to null
constrained version of a linked list
push
pop
adds a new node to the top of the stac

This is a continuation from the previous group assignment. You can just add to your previous group
assignment. Evaluate the postfix expression that has been placed in the queue from the previous group
assignment and display the result.
Precondition:
The

Populate a queue with a list of integers (both positive and negative) from a file (input.txt). Write an
algorithm that deletes all negative integers without changing the order of the remaining elements.
Duplicates are allowed.
Do not use a counter to keep

Circular, doubly linked list
Create a circular, doubly linked list from a file (input.txt), containing a list of names. The number of
names is unknown.
Prompt the user for the number of nodes to delete and then delete accordingly from the list.
Assumption

Populate a binary search tree from an input file (input.txt) that contains a list of numbers. The file can
also contain the keyword delete followed by a number. Search for a node within the tree for that number
and delete it. If the number is not found, i

1) Given bubble, selection and insertion sort, I will ask you what the array looks would look like at
the first moment when a bunch of elements are in order?
For example, given an array with the following elements:
43, 22, 17, 36, 16
Using bubble sort , e

Depth First traversal
There are three types of depth-first traversal: pre-order, in-order and post-order. For a binary tree,
they are defined as operations recursively at each node, starting with the root node as follows:
Pre-order
1. Visit the root.
2. T

1) Insert 80 into this tree. The resulting tree must be an AVL tree. Draw the new tree after it
has been balanced. Also, what is the balance factor at the root level after everything has
been balanced?
Drawthetree
Heightoftherootafterrebalance:
BalanceFac

Tower of Hanoi
The Tower of Hanoi (also called the Tower of Brahma or Lucas' Tower,[1] and sometimes
pluralized) is a mathematical game or puzzle. It consists of three rods, and a number of disks of
different sizes which can slide onto any rod. The puzzle

Doubly linked list
Create a doubly linked list from a file (input.txt). The number of items is unknown.
(Delete from head) Prompt the user for a node number. Starting from the head, moving forward, go to
the node and delete it.
(Delete from tail) Prompt t

Split
Create a linked list called myList from an input file (inputSplit.txt) that contains an even number
of first names. The number of items in the file is unknown.
Create a split function that divides the newly created linked list into two equal sublist

Quicksort
Quicksort is a divide and conquer algorithm.
1. Pick an element, called a pivot, from the array. Can be the first element, last element, middle
element, some random element. In our example, we will use the 1st element.
2. Reorder the array so th

Your program will sort a two dimensional array (5 * 4) based on the following:
a) The entire array should be sorted using bubble sort based on the 1 st column in ascending order
and display the entire array.
b) Reset the array to its original contents. Th

Heaps
There are two types of heap: min-heap and max-heap. Elements in the heap are not perfectly ordered as in a binary
search tree. The heap has two basic properties:
Order property
Min-heap:
The value of each node is smaller
than or equal to the values

In a doubly linked list:
Every node has two links: one points to the next node and one points to the pervious
node.
Insertions and deletions now require more operations but other operations are simplified.
The list can be traversed in either direction.

Tree Definition
What is a tree?
A tree is a non-linear data structure that consists of a
root node and potentially many levels of additional nodes
that form a hierarchy. A tree can be empty with no nodes,
consist of one node, called the root, or, one or m

Modify the quicksort algorithm such that it uses the last item as the pivot instead of the 1 st. Also, sort in
descending order, instead of ascending order.
NOTE: Do not move the last element into the first element of the array. You must treat the algorit

1) Write a program that takes an integer from the user and converts it into its proper binary and
hexadecimal representation using a LIFO structure.
Precondition: The decimal numbers will be integers and positive.
Binary
10
10 mod 2 =0,
5 mod 2 =1,
2 mod

What is hashing
Hashing means to chop and mix.
A bucket in a hash file is a unit of storage (typically a disk block) that can hold one or more
records.
The hash function, h, is a function from the set of all search-keys, K, to the set of all bucket
addres

Write a recursive function that does the following:
Given a number, add all the digits and display the sum.
Example:
The sum of the number 5432 would be 14.
o Do not use the static modifier. No global variables. Your program should implement a
non-tail re

For this assignment, you will declare an array that can hold up to 10 elements. The elements will be read
from a file. Use the modulo-division to come up with a location. If there is a collision, then use double
hashing. The formula that you should use fo

The act of swapping two variables refers to mutually exchanging the values of the
variables. This can be done with or without temporary variables. The following
shows swapping being done using a temp variable.
int main( )
cfw_
int a=10,
b=20,
temp;
int c[

1) What would be the contents of queue Q1 and queue Q2 after the following is executed given the
following data: (5, 7, 12, 4, 0, 4, 6)
Q1=createQueue
Q2=createQueue
Loop (not end of file)
read number
enqueue (Q1, number)
enqueue (Q2, number)
loop (not em