CSL356
Sept 11,15,16
TUTORIAL SHEET 6
1. [KT-Chapter6] Suppose we want to replicate a file over a collection of n servers,
labeled S1 , S2 , . . . , Sn . To place a copy of the file at server Si results in a placement
cost of ci , for an integer ci > 0. N
CSL356
Aug 11,12,14
TUTORIAL SHEET 2
1. You are given a line with n points, labeled 1 to n, marked on it. You are also given a
set of intervals I1 , . . . , Ik , where interval Ii is of the form [si , ei ], 1 si ei n. Find
a set of points X of smallest ca
CSL356
Aug 18, 19, 21
TUTORIAL SHEET 3
1. You are given a set of intervals on a line segment. You wish to color these segments
such that no two overlapping segments get the same color. Devise a greedy algorithm
for coloring the intervals which uses as few
State Space Search for
Solving problems
Lecture Module 4
8/3/2017
Prof Saroj Kaushik
1
State Space Search
State space is another method of problem
representation that facilitates easy search similar
to PS.
In this method also problem is viewed as finding
CSL356
TUTORIAL SHEET 10
1. Suppose you have algorithm A which given a graph G and a number k , outputs YES
iff G has a vertex cover of size at most k. Assuming that A runs in polynomial time,
show that you can find a vertex cover of minimum size in polyn
CSL356
Oct 6, 7, 9
TUTORIAL SHEET 8
1. [KT-Chapter7] Consider the following problem. You are given a flow network with
unit-capacity edges: it consists of a directed graph G = (V, E), a source s and a sink
t, and ue = 1 for every edge e. You are also give
CSL356
Sept 4,8,9
TUTORIAL SHEET 5
1. [KT-Chapter6] Suppose you own two stores, A and B. On each day you can be
either at A or B. If you are currently at store A (or B) then moving to store B the
next day (or A) will cost C amount of money. For each day i
CSL356
TUTORIAL SHEET 12
1. [KT-Chapter8] You have a set of friends F whom youre considering to invite, and
youre aware of a set of k project groups, S1 , . . . , Sk , among these friends (these sets
need not be disjoint). The problem is to decide if ther
CSL356
TUTORIAL SHEET 9
1. [KT-Chapter7] You have a collection of n software applications, cfw_1, . . . , n, running
on an old system; and now you would like to port some of these to the new system.
If you move application i to the new system, you expect
CSL356
Sept 22,23,29
TUTORIAL SHEET 7
1. [KT-Chapter6] Suppose you are given a directed graph G = (V, E) with length le
on edges (which could be negative), and a sink vertex t. Assume you are also given
finite values d(v) for all the vertices v V . Someon
CSL356
TUTORIAL SHEET 12
1. [KT-Chapter8] Consider a set A = cfw_a1 , ., an and a collection B1 , B2 , ., Bm of
subsets of A. (That is, Bi A for each i.) We say that a set H A is a hitting set for
the collection B1 , B2 , ., Bm if H contains at least one
COL106: Data Structures, I Semester 2015-16
Assignments 2 and 3
Mobile phone tracking system
September 16, 2015
In these two assignments, we will design a data structure that will help
us solve a simplified version of the mobile phone tracking problem, i.
COL106: Data Structures, I Semester 2015-16
Assignment 1
Stack Sortable Permutations
Deadline: 11:55PM, 7 September 2015
August 27, 2015
The aim of this assignment is to test whether a given sequence of numbers
is a stack-sortable permutation or not. A st
COL106: Data Structures and Algorithms (IIT Delhi, Semester-II-2016-17)
Programming-4
There are 1 questions for a total of 100 points.
(100)
1. We would like to develop some software for Training and Placement (T&P cell) at IIT Delhi for helping
them to m
COL106: Data Structures and Algorithms (IIT Delhi, Semester-II-2016-17)
Programming-1
There are 1 questions for a total of 100 points.
(100)
1. The first programming assignment will involve working with large binary numbers and understanding
running time
COL106: Data Structures and Algorithms (IIT Delhi, Semester-II-2016-17)
Programming-3
There are 1 questions for a total of 100 points.
(100)
1. We would like to develop some software for Rendezvouz-2017 which will help you keep track of scores
in various
COL106: Data Structures and Algorithms (IIT Delhi, Semester-II-2016-17)
Programming-2
There are 1 questions for a total of 100 points.
(100)
1. The second programming assignment will involve using one data structure to implement another.
In lectures, we d
ABOUT URI
ADMISSION
ACADEMICS
CAMPUS LIFE
ATHLETICS
RESEARCH & OUTREACH
GLOBAL
The University of Rhode Island
Search The Un
Webmail
eCampus
Sakai
University of Rhode Island Food Safety
Education
College of the Environment and Life Sciences
HOME
LINKS
CON
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Graph Algorithms
BFS application
Bipartite graph: A graph is bipartite i the vertices can be
partitioned into two sets such t
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Graph Algorithms
Connectivity
A graph may not always be connected.
A connected component in an undirected graph is a maximal
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Heaps and Priority Queues
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
H
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Tree
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Tree ! Binary Tree
A b
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Balanced Binary Search Trees
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structure
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Linked List
Linked List: A collection of nodes with linear ordering defined on
them.
Each node holds an eleme
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Hashing
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Hashing
We have see
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Balanced Binary Search Trees
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structure
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Multiway Search Trees ! (2,4)-Trees
Definition (2-4)-Tree)
A (2, 4)-Tree is a multiway search tree with the f
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures: Universal Hashing
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Universal
COL106: Data Structures and Algorithms
Ragesh Jaiswal, IIT Delhi
Ragesh Jaiswal, IIT Delhi
COL106: Data Structures and Algorithms
Data Structures
Balanced Binary Search Trees ! AVL Trees
Question: How do we perform remove(k) operation on an AVL
tree?
Algo