Project #4
Due Dates: Saturday, October 29 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. All work should be your own.
Objectives:
Create a hash table.
Use the hash table to solve a w
1.A. Adding or deleting elements in the linked list is much easier. Only task is to assign the link. In
arrays, shifting position of elements is necessary if the operation is not at the end of the list.
B. Getting an element by an index position is much e
1. N>=n0 is needed as for lower values of N, the time complexity might not be much significant.
However, after N>=n0, the relative rates of growth become comparable for larger values of N.
2. This is because for larger values of N, the growth rates for bo
AVL Trees
6
v
8
3
z
4
2004 Goodrich, Tamassia
AVL Trees
1
AVL Tree Definition
AVL trees are
balanced
2
An AVL Tree is a
binary search tree
such that for every
internal node v of T,
the heights of the
children of v can
differ by at most 1
2004 Goodrich,
Red-Black Trees
6
v
8
3
z
4
2004 Goodrich, Tamassia
Red-Black Trees
1
From (2,4) to Red-Black Trees
A red-black tree is a representation of a (2,4) tree by means of a
binary tree whose nodes are colored red or black
In comparison with its associated (2,4
CS5343: Algorithm Analysis and Data Structures
Prof. Sergey Bereg
Deletion in Red-Black Trees
delete(k)
Delete as in BST: nd node v with key k and (i) delete it if it has an external child, or (ii) nd its
successor u, move entry of u to v , delete u.
If
Divide-and-Conquer
7 29 4 2 4 7 9
72 2 7
77
2004 Goodrich, Tamassia
22
Divide-and-Conquer
94 4 9
99
44
1
Divide-and-Conquer
Divide-and conquer is a
general algorithm design
paradigm:
Divide: divide the input data S in
two or more disjoint subsets S1,
S2,
Selection
2004 Goodrich, Tamassia
Selection
1
The Selection Problem
Given an integer k and n elements x1, x2, , xn,
taken from a total order, find the k-th smallest
element in this set.
Of course, we can sort the set in O(n log n) time
and then index the
Quick-Sort
7496224679
4224
22
2004 Goodrich, Tamassia
7979
99
Quick-Sort
1
Quick-Sort
Quick-sort is a randomized
sorting algorithm based
on the divide-and-conquer
paradigm:
x
Divide: pick a random
element x (called pivot) and
partition S into
x
L elemen
Section 3: Process Description and Control
Question 1
1. What is the purpose of the Process Control Block?
2. Describe the three categories of information present in the process control
block as shown in Figure 3.13 in the text book.
3. What is being repr
Assignment #4
Due Dates: Monday, October 10 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. Answers should be your own work.
Chapter 4
6 points
1. Tree traversals.
Give the sequence of l
Assignment #5
Due Dates: Wednesday, Oct 19 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. Answers should be your own work.
Chapter 4, 5
10 points
1) Draw a red-black tree for the follow
Project #3
Due Dates: Monday, October 17 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. Answers should be your own work.
Introduction:
In this project you will modify the author's Binar
Assignment #3
Due Dates: Wednesday, September 21 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. Answers should be your own work.
Chapter 3
10 points
1. Linked lists and arrays:
a. What
Project #2
Due Dates: Saturday, Sept. 24 at 11:59pm
Submit: eLearning
Late Policy: -10 points per hour late
Instructions: This is an individual assignment. Answers should be your own work.
Introduction:
In this project you will add methods to an existing
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Assignment 4
1. A. Inorder- acedqnrws
B. Preorder- qecadrnsw
C. Post order- acdenwsrq
2.
8. Size of each block=3096 bytes
Size of data records=36 bytes
So number of data records=86 L
Key = 4 bytes
Pointer= 4 bytes
So, 4(M-1) +4(M)=3096
8M=3100
M=387.5 =
Section 2: Operating System Overview
Question 1
Describe the difference between API and ABI services / functions.
Answer
The Application Programming Interface (API) are libraries provided by the OS to
perform common functions including process management,
1. To compute log base 2 of 2048 using only log base 10, the expression can be written as: Log base 2 of 2048= (log base 10 of 2048) / (log base 10 of 2).
2.
3 + 5 + 7 + 9 + . + 2k+1
= 2(1+2+3+4+ +k) + (1+1+1 k times)
= 2k(k+1) /2 +k
=k(k+1) + k
=k^2 + k
Breadth-First Search
L0
L1
B
L2
2010 Goodrich, Tamassia
A
Breadth-First Search
C
E
D
F
1
Breadth-First Search
Breadth-first search
(BFS) is a general
technique for traversing
a graph
A BFS traversal of a
graph G
Visits all the vertices and
edges of G
Det
Biconnectivity
SEA
PVD
ORD
SNA
FCO
MIA
Outline and Reading
Definitions
Separation vertices and edges
Biconnected graph
Biconnected components
Equivalence classes
Linked edges and link components
Algorithms
Auxiliary graph
Proxy graph
Separation Edges and
Priority Queues (Heaps)
Chapter 6
Fall 2012
2012 by Greg Ozbirn, UT-Dallas, for use with
Data Structures book by Mark Allen Weiss
1
Introduction
A queue is a FIFO data structure.
Each item in the queue is treated equally.
There may be times when we wi
The Disjoint Set ADT
Chapter 8
Fall 2012
2012 by Greg Ozbirn, UT-Dallas, for use with
Data Structures book by Mark Allen Weiss
1
Disjoint Set ADT
This chapter introduces the disjoint set ADT.
The disjoint set involves two basic operations,
union and fi
Chapter 4
Trees
Fall 2012
2012 by Greg Ozbirn, UT-Dallas, for use with
Data Structures book by Mark Allen Weiss
1
Trees
Linked lists require O(N) time to traverse the list.
For large lists this is prohibitive.
A simple data structure called a tree can
Chapter 5
Hashing
Fall 2012
2012 by Greg Ozbirn, UT-Dallas, for use with
Data Structures book by Mark Allen Weiss
1
Hashing
Hashing is a technique that can perform
inserts, deletions, and finds in constant
average time.
It does not support some of the