A linked list is a data structure in which the objects are arranged in a linear order.
Unlike an array, however, in which the linear order is determined by the array
indices, the order in a linked list is determined by a pointer in each object.
m.V&W-bm Hw 7%Sbgp w A 7'
Mimmdm jmm' M 7' . n I e
. I -. 1m .u, 5
, +" / I
_ o I: T+ 2-
. o, L
T ., I. an am g.I./+1/Qowf -+
0nd na eat
A . r. f I
. A' m . -(' IA 4., I c 0r 4 , o 1 .o
_W Km 1. f
(,h + C' o_+10na '0 Cl
1> Wl I)
CISC 235: Topic 8
We have an unsorted array A containing N
records stored on secondary / tertiary storage
We need to sort the contents of A
Cannot implement the sorting of A o
"Shakespeare is the happy hunting ground of all minds that have lost their balance."
This assignment is to be completed individually. Please refer to the statement on academic
March 26, 2017
In this assignment you will experiment with Breadth-First Search and Prim's MST
algorithm. BFS has already been covered in class and in the notes Prims algorithm will
be covered on Monday March 27.
Your work on hashing
Due Date: March 19, 2017
In this assignment you will experiment with hash functions.
You have been hired as a consultant for a new government agency called the Canadian
Intelligence and Secrecy Council (CISC). Your assigned task is t
Problem: We need to maintain a sorted list to
facilitate searching, with insertions and
deletions occurring, but we have more data
than can fit in main memory.
Task: Design a data structure that will minimize
Can any of t
Stacks and queues are dynamic sets in which the element removed from the set
by the DELETE operation is prespecified. In a stack, the element deleted from
the set is the one most recently inserted: the stack implements a last-in, first-out
Collision resolution by chaining
In chaining, we place all the elements that hash to the same slot into the same
linked list, as Figure 11.3 shows. Slot j contains a pointer to the head of the list of
all stored elements that hash to j ; if there are no s
Red Black Trees
A red-black tree is a binary search tree with one extra bit of storage per node: its
color, which can be either RED or BLACK. By constraining the node colors on any
simple path from the root to a leaf, red-black trees ensure that no such p
Binary Search Tree
A binary search tree is organized, as the name suggests, in a binary tree, as shown
in Figure 12.1. We can represent such a tree by a linked data structure in which
each node is an object. In addition to a key and satellite data, each n
Many applications require a dynamic set that supports only the dictionary operations
INSERT, SEARCH, and DELETE. For example, a compiler that translates a
programming language maintains a symbol table, in which the keys of elements
nonetheless use the number of pages read or written as a first-order approximation
of the total time spent accessing the disk.
In a typical B-tree application, the amount of data handled is so large that all
the data do not fit into main memory at
B-trees are balanced search trees designed to work well on disks or other directaccess
secondary storage devices. B-trees are similar to red-black trees (Chapter
13), but they are better at minimizing disk I/O operations. Many database systems
What makes a good hash function?
A good hash function satisfies (approximately) the assumption of simple uniform
hashing: each key is equally likely to hash to any of the m slots, independently of
where any other key has hashed to. Unfortun
The downside of direct addressing is obvious: if the universe U is large, storing
a table T of size jUj may be impractical, or even impossible, given the memory
available on a typical computer. Furthermore, the set K of keys actually stored
February 5, 2017
In this assignment you will explore some properties of Red-Black trees and compare them
to plain Binary Search Trees.
Implement a BinaryTreeVertex class in which each object has at least these attributes: