SlideShare a Scribd company logo
This question paper contains 7 printed pages]
Roll No. I I I f I I I I I I 1· I
S. No. ofQuestion Paper : 6070
Unique Paper Code : 234301
Name ofthe Paper
Name ofthe Course
Semester
: Design and Analysis ofAlgorithms (CSHT:305)
: B.Sc. (Hons.) Computer Science
: III
D
Duration :3 Hours Maximum Marks :75
(Write your Roll No. on the top immediately on receipt of this question paper) ·
Question No. 1 of 35 marks is compulsory.
Attempt any four questions from Q. No. 2 to Q. No. 7.
1·. (a) Prove that the average running time of Quicksort is O(n lg ·n) where n is the number
ofelements. 5
(b) Determine an LCS of <1, 0, 0, I, 0, 1, 0, 1> and <0, 1, 0, 1, 1, 0, 1, 1, 0>. 5
(c) Beginning with an empty red-black tree insert in succession the following keys : 5
10 20 30 80 50 70 75
From the above tree delete 20.
P.T.O.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
,
( 2 )
(d) Consider the following recursive function:
TOH(in n, char from, char to,.char aux) .
{
if(n==I)
Cout<<"Move disk I from "<<from<<" to "<<to;
else
{
TOH (n-1, from,aux,to);
cout<<"Move disk"<<n<<" from"<<from<<"to"<<to;
TOH(n-1,aux,to,from);
}
}
6070
5
Let T(n) represents the total number of moves required to move n disks from one
tower to another. Give a recurrence relation for T(n). Find T(n) in terms of
big Oh.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
( 3 ) 6070
(e) · Apply DFS algorithm on the following graph. Assume that adjacency lists are in
alphabetical order. Also classify the different edges as tree, forward, back and
cross edge. 5
(j) Is it always true th~t an array that is already sorted is a best-case input for sorting.
algorithms ? Give an argument or a counterexample. 3
(g) Suppose the elements in an array are (starting at index 1) 25, 19,.15, 5, 12, 4, 13,
3, 7, 10. Does this array represent a heap ? Justify your answer. 2
(h) Suppose we perform a sequence of n operations on a data structure in which the
/h operation costs i if i is an exact power of2 and 1 otherwise~ Use aggregate analysis
to determine the amortized cost per operation. 5
P.T.O.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
I
L,
( 4 ) . 6070
2. (a) Suppose that you are given n red and n blue water jugs, all of different shapes and
sizes. All red jugs hold different amounts of water, as do the blue ones. Moreover, for
every red jug, there is a blue jug that holds the same amount of water, and vice versa.
It is yourtask to find a grouping of the jugs into pairs of red· and blue jugs that hold
the same amount of water.
To do so, you may perform the following operation : pick a pair of jugs in which
one is red and one is blue, fill the red jug with water, and then pour the wat~r
into the blue jug. This operation will tell you whether the red or the blue jug can hold
more water, or if they are of the same volume. Assurrie that such a comparison takes
one time unit. Your goal is to give an algorithm that uses O(n2) comparisons to group
the jugs into pairs. Remember that you may not directly compare two red jugs or two
blue jugs. 5
(b) Find the average/expected time taken by bucket sort to sort an array containing.
n elements. 5
3. (a) Suppose we are to find the k smallest elements in a list ofn elements, and we are not
interested in their relative order. Give a linear time algorithm for the same. 5
(h) Suppose that CONNECTED-COMPONENTS is run on the undirected graph
G = (V, E), where V = {a, b, c, d, e, j, g, h, i, j, k} and the edges of E are
processed in the following order : (d, i), if, k), (g, i), (b, g), (a, h), (i, j), (d, k),
(b, j), (d, f), (g, j), (a, e), (i, d). List the vertices in each connected component
after each iteration. 5
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
( 5 ) 6070
4. (a) Suppose that we have numbers between 1 and 50 in a red-black tree and want to
search for the number 19. Which of the following sequences could not be the sequence
of nodes examined ?
(i) 26, 28, 15, 17, 19
(ii) 35, 12, 28, 17, 19. 2
(b) Let a, b and c be arbitrary nodes m subtrees a, ~ and y respectively, in the
following figure. How do the depths ofa, b and c change when a left rotation is performed
on node x in the figure ? 3
.y
(c) What is the 'largest possible number of internal nodes in a red-black tree with
black-height k ? What is the smallest possible number of nodes ?
(d) What is an order-statistic tree ? Explain and give an example.
3
2
P.T.O.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
( 6 ) 6070
5. (a) What is memorization? Show how this helps in increasing the efficiency ofa recursive
program. 5
(b) Not just any greedy approach to the activity-selection problem produces a maximum-
size set ofmutually compatible activities. Give an example to show that the approach
ofselecting the activity ofleast duration from those that are compatible with previously
selected activities does not work. 5
6. (a) Find the minimum spanning tree for the following graph using Kruskal's algorithm. 5
(b) A bipartite graph is a graph whose vertices may be partitioned into two subsets such
that there is no edge between any two vertices in the same subset. Write an algorithm
to find whether a given directed graph is bipartite or not. 5
. ~
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
( 7 ) 6070
7. (a) Find the failure indexes for the following pattern :
AABAACAABABA
Assume array indexes are starting from 1.
5
(b) Is Prim's minimum spanning tree algorithm a greedy algorithm? Justify your answer. Also
give running time ofthe algorithm.
5
. .
6070 7 1,200
----------------------------
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc.
For any query, contact us at help@tutorialsduniya.com
TutorialsD
uniya.com
Design and analysis of algorithms  question paper 2015   tutorialsduniya.com

More Related Content

What's hot

Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
Sudhaa Ravi
 
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptxPLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
LuisAlejandroPv
 
Ch 18 intro to network layer - section 1
Ch 18   intro to network layer - section 1Ch 18   intro to network layer - section 1
Ch 18 intro to network layer - section 1
Hossam El-Deen Osama
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMSkoolkampus
 
Deadlock- Operating System
Deadlock- Operating SystemDeadlock- Operating System
Deadlock- Operating System
Rajan Shah
 
Secondary storage structure
Secondary storage structureSecondary storage structure
Secondary storage structure
Priya Selvaraj
 
Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
Bharathi Lakshmi Pon
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Pawandeep Kaur
 
Evolution of Programming Languages
Evolution of Programming LanguagesEvolution of Programming Languages
Evolution of Programming Languages
Sayanee Basu
 
EC6703 unit-4
EC6703 unit-4EC6703 unit-4
EC6703 unit-4
RajalakshmiSermadurai
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
NancyBeaulah_R
 
Taboo language
Taboo languageTaboo language
Taboo language
Olivia Lovatt
 
resource management
  resource management  resource management
resource managementAshish Kumar
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and Type
LalfakawmaKh
 
Top-down and bottom-up approaches to language planning.
Top-down and bottom-up approaches to language planning. Top-down and bottom-up approaches to language planning.
Top-down and bottom-up approaches to language planning.
Saad Yaseen
 
Loops in flow
Loops in flowLoops in flow
Loops in flow
indhu mathi
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
Amir Payberah
 
Introduction to system programming
Introduction to system programmingIntroduction to system programming
Introduction to system programming
sonalikharade3
 
How To Triple The Range of LoRa
How To Triple The Range of LoRaHow To Triple The Range of LoRa
How To Triple The Range of LoRa
Haystack Technologies
 

What's hot (20)

Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
 
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptxPLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
PLANIFICACIÓN DE SISTEMAS - WINDOWS - SISTEMAS OPERATIVOS - III (2).pptx
 
Ch 18 intro to network layer - section 1
Ch 18   intro to network layer - section 1Ch 18   intro to network layer - section 1
Ch 18 intro to network layer - section 1
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMS
 
Deadlock- Operating System
Deadlock- Operating SystemDeadlock- Operating System
Deadlock- Operating System
 
Secondary storage structure
Secondary storage structureSecondary storage structure
Secondary storage structure
 
Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Evolution of Programming Languages
Evolution of Programming LanguagesEvolution of Programming Languages
Evolution of Programming Languages
 
EC6703 unit-4
EC6703 unit-4EC6703 unit-4
EC6703 unit-4
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
 
Taboo language
Taboo languageTaboo language
Taboo language
 
resource management
  resource management  resource management
resource management
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and Type
 
Top-down and bottom-up approaches to language planning.
Top-down and bottom-up approaches to language planning. Top-down and bottom-up approaches to language planning.
Top-down and bottom-up approaches to language planning.
 
Loops in flow
Loops in flowLoops in flow
Loops in flow
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
 
Introduction to system programming
Introduction to system programmingIntroduction to system programming
Introduction to system programming
 
Ch6
Ch6Ch6
Ch6
 
How To Triple The Range of LoRa
How To Triple The Range of LoRaHow To Triple The Range of LoRa
How To Triple The Range of LoRa
 

Similar to Design and analysis of algorithms question paper 2015 tutorialsduniya.com

Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
Programming Homework Help
 
Algorithm Homework Help
Algorithm Homework HelpAlgorithm Homework Help
Algorithm Homework Help
Programming Homework Help
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Algorithms Exam Help
Algorithms Exam HelpAlgorithms Exam Help
Algorithms Exam Help
Programming Exam Help
 
Algorithm Homework Help
Algorithm Homework HelpAlgorithm Homework Help
Algorithm Homework Help
Programming Homework Help
 
MyStataLab Assignment Help
MyStataLab Assignment HelpMyStataLab Assignment Help
MyStataLab Assignment Help
Statistics Assignment Help
 
Cwkaa 2010
Cwkaa 2010Cwkaa 2010
Cwkaa 2010
Sam Neaves
 
Ee693 sept2014midsem
Ee693 sept2014midsemEe693 sept2014midsem
Ee693 sept2014midsem
Gopi Saiteja
 
Adobe
AdobeAdobe
This quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutletThis quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutlet
Beardmore
 
Due Week 10 and worth 250 pointsIn preparation for this assignme.docx
Due Week 10 and worth 250 pointsIn preparation for this assignme.docxDue Week 10 and worth 250 pointsIn preparation for this assignme.docx
Due Week 10 and worth 250 pointsIn preparation for this assignme.docx
jacksnathalie
 
Dat 305 dat305 dat 305 education for service uopstudy.com
Dat 305 dat305 dat 305 education for service   uopstudy.comDat 305 dat305 dat 305 education for service   uopstudy.com
Dat 305 dat305 dat 305 education for service uopstudy.com
NewUOPCourse
 
Practive test 1
Practive test 1Practive test 1
Practive test 1
Long Beach City College
 
Programming Exam Help
Programming Exam Help Programming Exam Help
Programming Exam Help
Programming Exam Help
 
Blinkdb
BlinkdbBlinkdb
Blinkdb
Nitish Upreti
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
TutorialsDuniya.com
 
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
3rd Semester Computer Science and Engineering  (ACU-2022) Question papers3rd Semester Computer Science and Engineering  (ACU-2022) Question papers
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 

Similar to Design and analysis of algorithms question paper 2015 tutorialsduniya.com (20)

Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Algorithm Homework Help
Algorithm Homework HelpAlgorithm Homework Help
Algorithm Homework Help
 
Mit6 006 f11_quiz1
Mit6 006 f11_quiz1Mit6 006 f11_quiz1
Mit6 006 f11_quiz1
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
Algorithms Exam Help
Algorithms Exam HelpAlgorithms Exam Help
Algorithms Exam Help
 
Algorithm Homework Help
Algorithm Homework HelpAlgorithm Homework Help
Algorithm Homework Help
 
algo1
algo1algo1
algo1
 
MyStataLab Assignment Help
MyStataLab Assignment HelpMyStataLab Assignment Help
MyStataLab Assignment Help
 
Cwkaa 2010
Cwkaa 2010Cwkaa 2010
Cwkaa 2010
 
Ee693 sept2014midsem
Ee693 sept2014midsemEe693 sept2014midsem
Ee693 sept2014midsem
 
Adobe
AdobeAdobe
Adobe
 
This quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutletThis quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutlet
 
Due Week 10 and worth 250 pointsIn preparation for this assignme.docx
Due Week 10 and worth 250 pointsIn preparation for this assignme.docxDue Week 10 and worth 250 pointsIn preparation for this assignme.docx
Due Week 10 and worth 250 pointsIn preparation for this assignme.docx
 
Dat 305 dat305 dat 305 education for service uopstudy.com
Dat 305 dat305 dat 305 education for service   uopstudy.comDat 305 dat305 dat 305 education for service   uopstudy.com
Dat 305 dat305 dat 305 education for service uopstudy.com
 
Practive test 1
Practive test 1Practive test 1
Practive test 1
 
Programming Exam Help
Programming Exam Help Programming Exam Help
Programming Exam Help
 
Blinkdb
BlinkdbBlinkdb
Blinkdb
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
 
Linear sorting
Linear sortingLinear sorting
Linear sorting
 
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
3rd Semester Computer Science and Engineering  (ACU-2022) Question papers3rd Semester Computer Science and Engineering  (ACU-2022) Question papers
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
 

More from TutorialsDuniya.com

Ba programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir NotesBa programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir NotesDU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir NotesBa programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir NotesBa programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
TutorialsDuniya.com
 
BA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir NotesBA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir Notes
TutorialsDuniya.com
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir NotesDU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir NotesDU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir NotesDU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir NotesDU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir Notes
TutorialsDuniya.com
 
DU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir NotesDU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir Notes
TutorialsDuniya.com
 
Computer graphics notes 4 tutorials duniya
Computer graphics notes 4   tutorials duniyaComputer graphics notes 4   tutorials duniya
Computer graphics notes 4 tutorials duniya
TutorialsDuniya.com
 
C++ notes 2 tutorials duniya
C++ notes 2   tutorials duniyaC++ notes 2   tutorials duniya
C++ notes 2 tutorials duniya
TutorialsDuniya.com
 

More from TutorialsDuniya.com (20)

Ba programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir NotesBa programme globalization notes Sartaz Sir Notes
Ba programme globalization notes Sartaz Sir Notes
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
 
DU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir NotesDU BA programme education notes Sartaz Sir Notes
DU BA programme education notes Sartaz Sir Notes
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
 
Ba programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir NotesBa programme economics notes Sartaz Sir Notes
Ba programme economics notes Sartaz Sir Notes
 
Ba programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir NotesBa programme political science notes Sartaz Sir Notes
Ba programme political science notes Sartaz Sir Notes
 
Ba programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir NotesBa programme human rights notes Sartaz Sir Notes
Ba programme human rights notes Sartaz Sir Notes
 
Ba programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir NotesBa programme history notes Sartaz Sir Notes
Ba programme history notes Sartaz Sir Notes
 
Ba programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir NotesBa programme hindi notes Sartaz Sir Notes
Ba programme hindi notes Sartaz Sir Notes
 
BA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir NotesBA programme education notes Sartaz Sir Notes
BA programme education notes Sartaz Sir Notes
 
Ba programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir NotesBa programme english notes Sartaz Sir Notes
Ba programme english notes Sartaz Sir Notes
 
DU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir NotesDU Ba programme education notes Sartaz Sir Notes
DU Ba programme education notes Sartaz Sir Notes
 
DU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir NotesDU Ba programme political science notes Sartaz Sir Notes
DU Ba programme political science notes Sartaz Sir Notes
 
DU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir NotesDU Ba programme hindi notes Sartaz Sir Notes
DU Ba programme hindi notes Sartaz Sir Notes
 
DU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir NotesDU Ba programme english notes Sartaz Sir Notes
DU Ba programme english notes Sartaz Sir Notes
 
DU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir NotesDU Ba programme history notes Sartaz Sir Notes
DU Ba programme history notes Sartaz Sir Notes
 
Computer graphics notes 4 tutorials duniya
Computer graphics notes 4   tutorials duniyaComputer graphics notes 4   tutorials duniya
Computer graphics notes 4 tutorials duniya
 
C++ notes 2 tutorials duniya
C++ notes 2   tutorials duniyaC++ notes 2   tutorials duniya
C++ notes 2 tutorials duniya
 

Recently uploaded

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 

Recently uploaded (20)

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 

Design and analysis of algorithms question paper 2015 tutorialsduniya.com

  • 1. This question paper contains 7 printed pages] Roll No. I I I f I I I I I I 1· I S. No. ofQuestion Paper : 6070 Unique Paper Code : 234301 Name ofthe Paper Name ofthe Course Semester : Design and Analysis ofAlgorithms (CSHT:305) : B.Sc. (Hons.) Computer Science : III D Duration :3 Hours Maximum Marks :75 (Write your Roll No. on the top immediately on receipt of this question paper) · Question No. 1 of 35 marks is compulsory. Attempt any four questions from Q. No. 2 to Q. No. 7. 1·. (a) Prove that the average running time of Quicksort is O(n lg ·n) where n is the number ofelements. 5 (b) Determine an LCS of <1, 0, 0, I, 0, 1, 0, 1> and <0, 1, 0, 1, 1, 0, 1, 1, 0>. 5 (c) Beginning with an empty red-black tree insert in succession the following keys : 5 10 20 30 80 50 70 75 From the above tree delete 20. P.T.O. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 2. , ( 2 ) (d) Consider the following recursive function: TOH(in n, char from, char to,.char aux) . { if(n==I) Cout<<"Move disk I from "<<from<<" to "<<to; else { TOH (n-1, from,aux,to); cout<<"Move disk"<<n<<" from"<<from<<"to"<<to; TOH(n-1,aux,to,from); } } 6070 5 Let T(n) represents the total number of moves required to move n disks from one tower to another. Give a recurrence relation for T(n). Find T(n) in terms of big Oh. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 3. ( 3 ) 6070 (e) · Apply DFS algorithm on the following graph. Assume that adjacency lists are in alphabetical order. Also classify the different edges as tree, forward, back and cross edge. 5 (j) Is it always true th~t an array that is already sorted is a best-case input for sorting. algorithms ? Give an argument or a counterexample. 3 (g) Suppose the elements in an array are (starting at index 1) 25, 19,.15, 5, 12, 4, 13, 3, 7, 10. Does this array represent a heap ? Justify your answer. 2 (h) Suppose we perform a sequence of n operations on a data structure in which the /h operation costs i if i is an exact power of2 and 1 otherwise~ Use aggregate analysis to determine the amortized cost per operation. 5 P.T.O. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 4. I L, ( 4 ) . 6070 2. (a) Suppose that you are given n red and n blue water jugs, all of different shapes and sizes. All red jugs hold different amounts of water, as do the blue ones. Moreover, for every red jug, there is a blue jug that holds the same amount of water, and vice versa. It is yourtask to find a grouping of the jugs into pairs of red· and blue jugs that hold the same amount of water. To do so, you may perform the following operation : pick a pair of jugs in which one is red and one is blue, fill the red jug with water, and then pour the wat~r into the blue jug. This operation will tell you whether the red or the blue jug can hold more water, or if they are of the same volume. Assurrie that such a comparison takes one time unit. Your goal is to give an algorithm that uses O(n2) comparisons to group the jugs into pairs. Remember that you may not directly compare two red jugs or two blue jugs. 5 (b) Find the average/expected time taken by bucket sort to sort an array containing. n elements. 5 3. (a) Suppose we are to find the k smallest elements in a list ofn elements, and we are not interested in their relative order. Give a linear time algorithm for the same. 5 (h) Suppose that CONNECTED-COMPONENTS is run on the undirected graph G = (V, E), where V = {a, b, c, d, e, j, g, h, i, j, k} and the edges of E are processed in the following order : (d, i), if, k), (g, i), (b, g), (a, h), (i, j), (d, k), (b, j), (d, f), (g, j), (a, e), (i, d). List the vertices in each connected component after each iteration. 5 Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 5. ( 5 ) 6070 4. (a) Suppose that we have numbers between 1 and 50 in a red-black tree and want to search for the number 19. Which of the following sequences could not be the sequence of nodes examined ? (i) 26, 28, 15, 17, 19 (ii) 35, 12, 28, 17, 19. 2 (b) Let a, b and c be arbitrary nodes m subtrees a, ~ and y respectively, in the following figure. How do the depths ofa, b and c change when a left rotation is performed on node x in the figure ? 3 .y (c) What is the 'largest possible number of internal nodes in a red-black tree with black-height k ? What is the smallest possible number of nodes ? (d) What is an order-statistic tree ? Explain and give an example. 3 2 P.T.O. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 6. ( 6 ) 6070 5. (a) What is memorization? Show how this helps in increasing the efficiency ofa recursive program. 5 (b) Not just any greedy approach to the activity-selection problem produces a maximum- size set ofmutually compatible activities. Give an example to show that the approach ofselecting the activity ofleast duration from those that are compatible with previously selected activities does not work. 5 6. (a) Find the minimum spanning tree for the following graph using Kruskal's algorithm. 5 (b) A bipartite graph is a graph whose vertices may be partitioned into two subsets such that there is no edge between any two vertices in the same subset. Write an algorithm to find whether a given directed graph is bipartite or not. 5 . ~ Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com
  • 7. ( 7 ) 6070 7. (a) Find the failure indexes for the following pattern : AABAACAABABA Assume array indexes are starting from 1. 5 (b) Is Prim's minimum spanning tree algorithm a greedy algorithm? Justify your answer. Also give running time ofthe algorithm. 5 . . 6070 7 1,200 ---------------------------- Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. Visit https://www.tutorialsduniya.com forNotes, books, programs, question papers with solutions etc. For any query, contact us at help@tutorialsduniya.com TutorialsD uniya.com