Professional Documents
Culture Documents
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
reviewer4@nptel.iitm.ac.in
Announcements (announcements)
Week 2
Programming
Assignment
Book cartons
A university department is shifting its department library to a more spacious
Week 3 : Graphs room on a newly constructed floor. The books from the library have been
packed into m cartons, numbered 1, 2, …, m, containing b1, b2, …, bm books,
Week 3 Quiz respectively, and transported to the new library room.
There are k student volunteers available to unpack the m cartons, where k ≤ m.
Each carton must be assigned to a single volunteer, and every volunteer must
t t ti f t t k
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 1/6
02/07/2020 Design and analysis of algorithms - Course
Input format
Heaps
Week 5 : Divide
Each test case consists of exactly two lines. The first line has are two integers
and Conqure
m and k. The second line has m integers b1, b2, …, bm separated by spaces.
Week 5 Quiz
Week 6: Data
Output format
Structures: Your output should be a single line with the input sequence b1, b2, …, bm
Search Trees divided into exactly k parts such that the maximum sum in a single part is as
small as possible. Use the slash character ('/') to separate the parts. There
Week 6: Greedy must be exactly one space character between any two successive numbers and
Algorithms between the number and the slash. If there is more than one solution, print the
one that minimizes the work assigned to the first volunteer, then to the second
Week 6 Quiz volunteer etc. Each volunteer must be assigned at least one carton.
Week 6
Programming Test Data:
Assignment
You may assume that 1 ≤ k ≤ m ≤ 500, always. Also, each carton contains a
Week 6 positive number of books, which is less than 10,000,000.
Programming
Assignment:
Book Cartons Sample Input 1:
(/noc20_cs27/progassignment?
name=122)
9 3
Week 7: 100 200 300 400 500 600 700 800 900
Dynamic
Programming
Week 7 Quiz
Sample Output 1:
Week 7 100 200 300 400 500 / 600 700 / 800 900
Programming
Assignment
Sample Input 2:
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 2/6
02/07/2020 Design and analysis of algorithms - Course
Week 8: Linear
5 4
Programming
100 100 100 100 100
and Network
Flows
Text Transcripts
100 99
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
Test 100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
Case 100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
2 100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 / 100 /
100 100 100 100 100
100 / 100 / 100 / 100 100
100 100 100 100 100
Test
500 499 100 / 100 / 100 / 100 / 100 /
Case
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
3
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 3/6
02/07/2020 Design and analysis of algorithms - Course
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 4/6
02/07/2020 Design and analysis of algorithms - Course
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 / 100 /
100 100 100 100 100 100 / 100 / 100 / 100 100
100 100 100 100 100
Test
4 2
Case 1 2 4 / 8
1 2 4 8
4
Test
6 2
Case 1 2 4 / 8 4 2
1 2 4 8 4 2
5
Test
6 2
Case 1 2 3 / 3 2 1
1 2 3 3 2 1
6
Test
2 2
Case 10000000 / 10000000
10000000 10000000
7
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 5/6
02/07/2020 Design and analysis of algorithms - Course
Test
6 3
Case 1000000 / 1 / 1 1 1 1
1000000 1 1 1 1 1
8
Test
6 3
Case 1 / 1 1 1 1 / 10000000
1 1 1 1 1 10000000
9
Test
6 6
Case 6 / 5 / 4 / 3 / 2 / 1
6 5 4 3 2 1
10
Test 9 3
100 200 300 400 500 / 600 700
Case 100 200 300 400 500
/ 800 900
11 600 700 800 900
Test
5 4
Case 100 / 100 / 100 / 100 100
100 100 100 100 100
12
https://onlinecourses.nptel.ac.in/noc20_cs27/progassignment?name=122 6/6