NPTEL Design and analysis of algorithms ASSIGNMENT 2021

Design and analysis

NPTEL Design and analysis of algorithms This course will cover basic concepts in the design and analysis of algorithms. Like Asymptotic complexity, O() notation, Sorting and search,Algorithms on graphs: exploration, connectivity, shortest paths, directed acyclic graphs, spanning trees

Join Our Official Telegram Channel

Design and analysis of algorithms is a MOOC course offered by Chennai Mathematical Institute on the NPTEL platform. The course is developed by Madhavan Mukund studied at IIT Bombay (BTech) and Aarhus University (PhD). He has been a faculty member at Chennai Mathematical Institute since 1992, where he is presently Professor and Director. His main research area is formal verification.

  1. INTENDED AUDIENCE: Students in BE/BTech Computer Science, 2nd/3rd year.
  2. Requirements/Prerequisites: Nil
  3. INDUSTRY SUPPORT:This course should be of value to any company working in the area of software services and products.ams.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the average of the best 6 assignments out of the total 8 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

Students will be eligible for CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If any of the 2 criteria are not met, the student will not get the certificate even if the Final score >= 40/100.

NPTEL Design and analysis of algorithms ASSIGNMENT WEEK 2 ANSWERS:-

Q1. Elections are on for the Siruseri Town Council. Elections in Siruseri work in a rather odd manner. Each candidate is assigned a unique identification number. The town is divided into five zones and each zone proposes a list of candidates, in some arbitrary order, that it would like to nominate to the Council. Any candidate who is proposed by three or more zones is elected. There is no lower limit or upper limit on the size of the Council.

Your task is to to calculate how many candidates are elected to the Council, given the lists proposed by the five zones.

For example, suppose the candidates proposed by the five zones are as follows:

  • Zone 1: [12,387,15,162,5]
  • Zone 2: [14,162,92,387,7,748]
  • Zone 3: [14,5,12,387]
  • Zone 4: [17,952,12,92,398,849]
  • Zone 5: [14,5,92,12,387]

In this example, 5 candidates are elected: these are [12,387,5,14,92].

Code:-

FOR DESIGN AND ANALYSIS QUIZ ASSIGNMENT:- DESIGN AND ANALYSIS OF ALGORITHMS

arr = list(map(int, input().split()))
l1=list(map(int, input().split()))
l2=list(map(int, input().split()))
l3=list(map(int, input().split()))
l4=list(map(int, input().split()))
l5=list(map(int, input().split()))
e=0;
d=0;
l1.extend(l2)
l1.extend(l3)
l1.extend(l4)
l1.extend(l5)
l1.sort()
min=l1[0];
for i in range(len(l1)):
    if(l1[i]==min):
        d=d+1;
    else:
        min=l1[i];
        if(d>=3):
            e=e+1;
        d=1;

print(e)

Note:- IF THERE ARE ANY CHANGE IN ANSWERS OF DESIGN AND ANALYSIS OF ALGORITHMS COURSE WILL GIVE UPDATE ON TELEGRAM SO KINDLY JOIN US THERE FOR GOOD SCORES.

quizxp telegram

Also check :- Internship oppurtinites