Design and Analysis of Algorithms
Spring 2014
National University of Computer and Emerging Sciences,
Islamabad
Recursion
Basic problem solving technique is to
divide a problem into smaller subproblems
These subproblems may also be divided
into smaller s
Design & Analysis of Algorithms - Spring 2012
Mid Term 2
April 14, 2012
Q1.
Time: 90 min
(15)
Run the strongly connected components algorithm on the following directed graphs G. During DFS
on GR: whenever there is a choice of vertices to explore, always p
Assignment 2
Computer Architecture
Fall 2015
(10 points)
Question 1) Assume you break up the memory stage into 2 stages instead of 1 to improve throughput in
a pipelined datapath.
Thus, the pipeline stages are now: F, D, EX, M1, M2, WB
Show how the instru
Design And Analysis of Algorithms Section A
Assignment 1
Due Date: 9th September 2015 In Class
Q1) Assume we are using 1-based indexing scheme.
In the loop invariant of insertion sort, before the first iteration of the outer for loop, what
is the value of
High Performance Data Warehouse
Design and Construction
OLAPImplementation
Techniques
1
Objectives
ProvidearobustframeworkforOLAP
techniquesfordecisionsupport.
Characterizetradeoffsinperformance,
scalability,flexibility,andcomplexity
associatedtovariousO
High Performance Data Warehouse
Design and Construction
IndexingTechniques:PartI
1
Objectives
Illustratetraditionaldatabaseindexingtechnologiesand
theirapplicationtodatawarehouseworkloads.
Provideaframeworkforunderstandingthebenefits(or
not)ofindexdeploym
High Performance Data Warehouse
Design and Construction
LogicalandPhysical
DatabaseDesign
1
Objectives
Reviewrulesofthirdnormalformdatabase
design.
Provideatoolkitofdenormalization
techniquesforphysicaldatabasedesign.
Characterizethetradeoffsinperforman
High Performance Data Warehouse
Design and Construction
IndexingTechniques:PartII
1
Objectives
IllustrateadvancedindexingtechnologiesforVLDBdata
warehousedesign.
Provideaframeworkforchoosingappropriateindexing
techniquesbasedonselectivityandaccesspatterns
Design And Analysis of Algorithms Assignment 2
Due date: 28 October Wednesday in class
Question 1. Using the top-down insertion algorithm described in the handout, add the following
elements one after the other in a 1-2-3 skip list. Show the skip list aft
Chapter
43
Deterministic
J. Ian
Thomas
Munrot
Skip
Lists*
Papadakist
Robert
Abstract
trees.
Reexplore
Denenberg,
techniques
guarantee
basic
idea
above
precisely
that
Thedesired
that
code, whereas
of memory
physical
of time
Our
and space with
we feel, inhe
DATA
WAREHOUSING
Introduction and Overview
What is a Data Warehouse?
Acompleterepositoryofcorporate
dataextractedfromtransaction
systemsthatisavailableforadhoc
accessbyknowledgeworkers.
What is a Data Warehouse? (2)
Thedatawarehouseisaninformationenvironm
High Performance Data Warehouse
Design and Construction
JoinTechniques
1
Objectives
Illustratefundamentaldifferencesbetweenjoin
techniquesinDSSandOLTPenvironments.
Describeperformancecharacteristicsformajorjoin
techniquesfoundinaDSSenvironment.
Describere
High Performance Data Warehouse
Design and Construction
AdvancedDatabaseDesign:
PartI
MIRaza
1
Objectives
Describeadvancedpartitioningtechniquesfor
physicaldatabasedesign.
Characterizethetradeoffsbetweentraditional
denormalizationandmaterializedviews.
MI
High Performance Data Warehouse
Design and Construction
AdvancedDatabaseDesign:
PartII
MIRaza
1
Objectives
Understandhowmaterializedviewscanbe
usedtomanipulatetablegeographiesin
sharednothingRDBMSimplementations.
DescribeemergingSQLfunctionsfor
advanceda
Design & Analysis of Algorithms I
Mid 2, Spring 2014
Date: 14th April. 2014
Time: 90 mins.
Q1. Consider the following 1-2-3 skip list
a. Insert 72 and then 92 in the above skip List
b. Delete the sequence of keys 30, 49 and 90 in the resultant skip list o
Design & Analysis of Algorithms - Spring 2014
Final Exam
Date: May19, 2014
Marks: 60
Time: 3 hours
Q1 [5+5 marks]
a. Consider the following pseudo code for heap sort
HEAPSORT(A)
1. BUILD-MAX-HEAP(A)
2. for i = lengthof(A) down to 2
3.
exchange A[1], A[i]
Design & Analysis of Algorithms I
Mid 2, Spring 2014
Date: 14th April. 2014
Time: 90 mins.
Q1. (10)
Consider the following 1-2-3 skip list
a. Insert 72 and then 92 in the above skip List
b. Delete the sequence of keys 30, 49 and 90 in the resultant skip l
DesignandAnalysisofAlgorithms
Spring2014
National University of Computer and Emerging Sciences, Islamabad
ExampleSorting(InsertionSort)
Insertion-Sort(A,n)
A[1 n]
for j = 2 to n
key = A[j]
i = j-1
while i > 0 and A[i] > key
A[i+1] = A[i]
i = i -1
1
A[i+1
Design and Analysis of Algorithms
Spring 2014
National University of Computer and Emerging Sciences,
Islamabad
Complexity Analysis
Want to achieve platform-independence
Use an abstract machine that uses steps of time and units
of memory, instead of secon
Design and Analysis of Algorithms
Sorting Algorithms
National University of Computer and Emerging Sciences,
Islamabad
Merge Sort (Divide and Conquer)
Example
Partition into lists of size n/2
[10, 4, 6, 3, 8, 2, 5, 7]
[10, 4, 6, 3]
[8, 2, 5, 7]
[6, 3]
[8,
Design and Analysis of Algorithms
Heap Sort
Spring 2016
National University of Computer and Emerging Sciences,
Islamabad
Special Types of Trees
Def: Full binary tree = a
binary tree in which each
node is either a leaf or has
degree exactly 2.
Def: Compl
Design and Analysis of Algorithms
Spring 2016
National University of Computer and Emerging Sciences, Islamabad
Hashing
Tables
Direct address tables
Hash tables
Collision and collision resolution
Chaining
Introduction
Many applications require a dyna
Design and Analysis of Algorithms
Spring 2016
National University of Computer and Emerging Sciences,
Islamabad
Hashing
Tables
Direct address tables
Hash tables
Collision and collision resolution
Chaining
Introduction
Many applications require a dyna
Design and Analysis of Algorithms
Sorting Algorithms
National University of Computer and Emerging Sciences, Islamabad
Merge Sort (Divide and Conquer)
Example
Partition into lists of size n/2
[10, 4, 6, 3, 8, 2, 5, 7]
[10, 4, 6, 3]
[8, 2, 5, 7]
[6, 3]
[8,
Design and Analysis of Algorithms
Heap Sort
Spring 2016
National University of Computer and Emerging Sciences, Islamabad
Special Types of Trees
Def: Full binary tree = a
binary tree in which each
node is either a leaf or has
degree exactly 2.
Def: Compl
Design and Analysis of Algorithms
Spring 2014
National University of Computer and Emerging Sciences FAST, Lahore
Credit Hours: 3
Prerequisites: Data Structures
Instructors: Ms. Saira Karim ([email protected])
Textbook:
Introduction to Algorithms by Co
Design & Analysis of Algorithms - Spring 2014
Final Exam
Date: May19, 2014
Marks: 60
Time: 3 hours
Q1 [5+5 marks]
a. Consider the following pseudo code for heap sort
HEAPSORT(A)
1. BUILD-MAX-HEAP(A)
2. for i = lengthof(A) down to 2
3.
exchange A[1], A[i]
Design & Analysis of Algorithms I
Mid 1, Spring 2014
Date: 27th Feb. 2014
Time: 90 mins.
Q1. (5+5)
Below are the pseudo codes for insertion sort and bubble sort. It is assumed that data is stored in
an array A[1 n]. Determine the loop invariant for the in
Design & Analysis of Algorithms - Spring 2012
Mid Term 1
March 03, 2012
Time: 90 min
Q1.
(15)
Devise an O(n) algorithm that determines the intersection of two sets of integers. The numbers in
the sets may be positive and/or negative. The intersection of t
Design & Analysis of Algorithms I
Mid 1, Spring 2014
Date: 27th Feb. 2014
Time: 90 mins.
Q1. (5+5)
Below are the pseudo codes for insertion sort and bubble sort. It is assumed that data is stored in
an array A[1 n]. Determine the loop invariant for the in