Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department University of Regina Fall 2010
CS340 Fall 2010
1
1. Algorithm Analysis
1. Algorithm Analysis
1.1 Mathe
University of Regina
CS 340
Assignment #4
Written Part: Graph Algorithms [48pts]
Exercise 1: exercise 9.6 page 379 (9.6 page 437 on 4th ed.) [4pts]
What is the worst-case running time of Djikstras alg
Alex Dalusong
200304912
Exercise 1:
What is the worst-case running time of Djikstras algorithm when implemented with d-heaps.
Answer:
Every time the main loop executes, one vertex is extracted from th
CS 340
Assignment 3
Total: 100pts
Dr. Malek Mouhoub
Exercise 1 : exercise 7.41 page 310 [8pts]
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algori
Alex Dalusong
200304912
Exercise 1:
What is the worst-case running time of Djikstras algorithm when implemented with d-heaps .
Answer:
Every time the main loop executes, one vertex is extracted from t
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
3. Priority Queues
3. Priority Queues
ADT Stack : LIFO.
ADT Queue :
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
5. Graphs and Networks
CS340
5. Graphs and Networks
Plan :
5.1 Introd
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
2. Trees
2. Trees
2.1 Preliminaries
2.2 Binary trees
2.3 Binary search
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
4. Sorting and Order-Statistics
4. Sorting and Order-Statistics
The so
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
6. Algorithm Design Techniques
6. Algorithm Design Techniques
6.1 Gree
Alex Dalusong
200304912
Exercise 1
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algorithm to sort 4 elements in 5 comparisons.
Answer:
log 4! = lo
Alex Dalusong
200304912
Exercise 1
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algorithm to sort 4 elements in 5 comparisons.
Answer:
log 4! = lo
2. Trees
2. Trees
2.1 Preliminaries 2.2 Binary trees 2.3 Binary search trees 2.4 AVL and Splay trees 2.5 B-trees
CS340 Fall 2010
1
2.1 Preliminaries
2.1 Preliminaries
Root A
B
C
D
E
F
G Height=3
Leave
Binary Trees in C+
Page 1 of 10
Binary Trees in C+
(Translated from the Java Verstion, see http:/math.hws.edu/javanotes/c11/s4.html)
WE HAVE SEEN how objects can be linked into lists. When an object c
CS340 Fall 2002 FINAL EXAM
Dr Malek Mouhoub December 11 2002 Duration : 3 hours (Total : 40pts)
Exercise 1 : Short Questions [5x1=5pts]
Dene the following concepts in your own words. 1. Decision tree
October 27 2006
Malek Mouhoub
CS 340 Midterm Exam
October 27 2006 Duration : 50 min - Total : 25pts
Exercise 1 : Algorithm Analysis [6pts]
Give an analysis of the running time (Big-Oh notation) for ea
CS3620 SPRING 2000 MIDTERM EXAM
Malek Mouhoub (02/29/99)
Exercise 1 (6 pts)
The input is an N by N matrix of numbers that is already in memory. Each individual row is increasing from left to right. Ea
CS340 Fall 2002 MIDTERM EXAM (SOLUTION)
Malek Mouhoub October 23 2002 Duration : 75min
Exercise 1 : Short Questions [5pts]
Dene the following concepts in your own words. 1. Abstract Data Type. 2. Bina
MIDTERM EXAM
Dr Malek Mouhoub
CS340 Winter 2006
March 01 2006 Duration : 75 min - Total : 25pts
Exercise 1 : Algorithm Analysis [6pts]
1. Give an analysis of the running time (Big-Oh notation) for eac
CmSc 250 Fundamentals of Computing III
Homework 05 SOLUTION
1. Determine the running time of mergesort for
a. Sorted input
b. Reverse-ordered input
c. Equal elements
Explain your answers.
In the three
Final Exam
Dr Malek Mouhoub
CS340 Winter 2006
Wednesday April 19 2006
Duration : 3 hours
Total : 50pts
(The question paper should be handed in with the completed examination)
Exercise 1 : Algorithm De