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
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
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
Tower of Hanoi
The Tower of Hanoi (also called the Tower of Brahma or Lucas' Tower, 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
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:
1. Visit the root.
(Using two queues)
D E F G
D E FG
Enqueue root on CurrentLevel
Enqueue left nextLevel
Enqueue right nextLevel
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
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
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.
stack new nodes can be added and removed only at the top
similar to a pile of dishes
Bottom of stack indicated by a link member to null
constrained version of a linked list
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.
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
Insert at the leaf. The inserted node will have a height of 0.
Since inserting occurred by traversing from the root all the way to a leaf node,
recursively, we have to go back until we end up back at the root. As we go back,
rebalance will be called on th
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
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:
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
Insertions and deletions now require more operations but other operations are simplified.
The list can be traversed in either direction.
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.
10 mod 2 =0,
5 mod 2 =1,
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
The hash function, h, is a function from the set of all search-keys, K, to the set of all bucket
Write a recursive function that does the following:
Given a number, add all the digits and display the sum.
The sum of the number 5432 would be 14.
o Do not use the static modifier. No global variables. Your program should implement a
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( )
We will create a binary tree, not a Binary Search Tree.
The construction starts with reading the postfix expression one symbol at a time. To do this we need a
tree structure and a stack that holds trees for each of its items.
A function is recursive if it calls itself.
Every recursive call reduces the original problem, bringing it increasingly closer to a
base case until it becomes that base case.
One or more base cases are used to stop recursion.
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.