SlideShare a Scribd company logo
1 of 2
Download to read offline
EE693 DATA STRUCTURES AND ALGORITHMS
QUIZ-GT-1 EXAMINATION
14 OCTOBER, 2014, Time: 1 Hours
EEE Department, IIT Guwahati
NOTE: Attempt and solve all the questions. Question-1 to Question-10 are objective questions (only one choice is
correct). Use of any kind of electronic media other than calculators are strictly prohibited. If anybody finds
voiding this rule will be penalized with -10 marks penalty. Please do not forget to mention your Name and
Roll No in the paper sheet. Please tick the correct choice. All the questions are of 2 marks. For any
wrong answer penalty of -1 marks will be imposed.
Name: Roll No:
1. This is the welcome question! All the best for EE693 Quiz-1 (GT).
In a complete k-ary tree, every internal node has exactly k children or no child. The number of leaves in such a tree
with n internal nodes is
(a) nk (b) (n-1)k+1 (c) n(k-1)+1 (d) n(k-1)
2. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of
nodes in a binary tree of height h is:
(a) 2h
− 1 (b) 2(h−1)
− 1 (c) 2(h+1)
− 1 (d) 2 × (h + 1)
3. Postorder traversal of a given binary search tree, T produces the following sequence of keys 10, 9, 23, 22, 27, 25, 15,
50, 95, 60, 40, 29 Which one of the following sequences of keys can be the result of an in-order traversal of the tree
T?
(a) 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95
(b) 9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29
(c) 29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95
(d) 95, 50, 60, 40, 27, 23, 22, 25, 10, 9, 15, 29
4. Following function is supposed to calculate the maximum depth or height of a Binary tree – the number of nodes
along the longest path from the root node down to the farthest leaf node.
int maxDepth(struct node* node)
{
if (node==NULL)
return 0;
else
{
/* compute the depth of each subtree */
int lDepth = maxDepth(node->left);
int rDepth = maxDepth(node->right);
/* use the larger one */
if (lDepth > rDepth)
return X;
else return Y;
}
}
(a) X = lDepth, Y = rDepth
(b) X = lDepth + 1, Y = rDepth + 1
(c) X = lDepth - 1, Y = rDepth -1
(d) None of the above
5. Following is C like pseudo code of a function that takes a Queue as an argument, and uses a stack S to do processing.
void fun(Queue *Q)
{
Stack S; // Say it creates an empty stack S
// Run while Q is not empty
while (!isEmpty(Q))
{
// deQueue an item from Q and push the dequeued item to S
push(&S, deQueue(Q));
}
// Run while Stack S is not empty
while (!isEmpty(&S))
{
// Pop an item from S and enqueue the poppped item to Q
enQueue(Q, pop(&S));
}
}
What does the above function do in general?
(a) Removes the last from Q
(b) Keeps the Q same as it was before the call
(c) Makes Q empty
(d) Reverses the Q
6. A priority queue can efficiently implemented using which of the following data structures? Assume that the number
of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority
item) operations are almost same.
(a) Array (b) Linked List (c) Heap Data Structures (d) None of the above
7. A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap
is given below: 10, 8, 5, 3, 2 Two new elements "1" and "7" are inserted in the heap in that order. The level-order
traversal of the heap after the insertion of the elements is:
(a) 10, 8, 7, 5, 3, 2, 1
(b) 10, 8, 7, 2, 3, 1, 5
(c) 10, 8, 7, 1, 2, 3, 5
(d) 10, 8, 7, 3, 2, 1, 5
8. Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in
addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this
modified stack?
(a) A queue cannot be implemented using this stack.
(b) A queue can be implemented where ENQUEUE takes a single instruction and
DEQUEUE takes a sequence of two instructions.
(c) A queue can be implemented where ENQUEUE takes a sequence of three instructions
and DEQUEUE takes a single instruction.
(d) A queue can be implemented where both ENQUEUE and DEQUEUE take a single instruction each.
9. A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x)
for each node x. If the cost of computing g(x) is min{no. of leaf-nodes in left-subtree of x, no. of leaf-nodes in
right-subtree of x}
then the worst-case time complexity of the program is
(a) Θ(n) (b) Θ(nLog(n)) (c) Θ(n2
) (d) Θ(n2
Log(n))
10. You are given the postorder traversal, P, of a binary search tree on the n elements 1,2,...,n. You have to determine
the unique binary search tree that has P as its postorder traversal. What is the time complexity of the most efficient
algorithm for doing this?
(a) O(Log(n)) (b) O(n) (c) O(nLog(n)) (d) None of the above
All the best for next week quiz.

More Related Content

What's hot

Exercise 2
Exercise 2Exercise 2
Exercise 2math126
 
Day 7 examples u6w14
Day 7 examples u6w14Day 7 examples u6w14
Day 7 examples u6w14jchartiersjsd
 
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016][Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]Mumbai B.Sc.IT Study
 
Exercise set 3.7
Exercise set 3.7Exercise set 3.7
Exercise set 3.7math265
 
10 mathfinal2011review
10 mathfinal2011review10 mathfinal2011review
10 mathfinal2011reviewJoshua Gerrard
 
7th PreAlg - L47--Jan17
7th PreAlg - L47--Jan177th PreAlg - L47--Jan17
7th PreAlg - L47--Jan17jdurst65
 
March 17, 2015
March 17, 2015March 17, 2015
March 17, 2015khyps13
 
Mathematicalfoundationofcomputerscience
MathematicalfoundationofcomputerscienceMathematicalfoundationofcomputerscience
Mathematicalfoundationofcomputersciencejntuworld
 
7th pre alg -l47--jan29
7th pre alg -l47--jan297th pre alg -l47--jan29
7th pre alg -l47--jan29jdurst65
 
Algorithms explained
Algorithms explainedAlgorithms explained
Algorithms explainedPIYUSH Dubey
 
Linked list Output tracing
Linked list Output tracingLinked list Output tracing
Linked list Output tracingSamsil Arefin
 
Va ha slant.ppt worked
Va ha slant.ppt workedVa ha slant.ppt worked
Va ha slant.ppt workedJonna Ramsey
 
Increasing and decreasing functions
Increasing and decreasing functionsIncreasing and decreasing functions
Increasing and decreasing functionsKarunaGupta1982
 

What's hot (20)

Exercise 2
Exercise 2Exercise 2
Exercise 2
 
Ch8
Ch8Ch8
Ch8
 
Day 7 examples u6w14
Day 7 examples u6w14Day 7 examples u6w14
Day 7 examples u6w14
 
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016][Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]
[Question Paper] Logic and Discrete Mathematics (Revised Course) [June / 2016]
 
Exercise set 3.7
Exercise set 3.7Exercise set 3.7
Exercise set 3.7
 
10 mathfinal2011review
10 mathfinal2011review10 mathfinal2011review
10 mathfinal2011review
 
7th PreAlg - L47--Jan17
7th PreAlg - L47--Jan177th PreAlg - L47--Jan17
7th PreAlg - L47--Jan17
 
March 17, 2015
March 17, 2015March 17, 2015
March 17, 2015
 
Mathematicalfoundationofcomputerscience
MathematicalfoundationofcomputerscienceMathematicalfoundationofcomputerscience
Mathematicalfoundationofcomputerscience
 
Alg2 lesson 7-7
Alg2 lesson 7-7Alg2 lesson 7-7
Alg2 lesson 7-7
 
Alg2 lesson 7.7
Alg2 lesson 7.7Alg2 lesson 7.7
Alg2 lesson 7.7
 
7th pre alg -l47--jan29
7th pre alg -l47--jan297th pre alg -l47--jan29
7th pre alg -l47--jan29
 
Day 6 examples
Day 6 examplesDay 6 examples
Day 6 examples
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
Functions
FunctionsFunctions
Functions
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
Algorithms explained
Algorithms explainedAlgorithms explained
Algorithms explained
 
Linked list Output tracing
Linked list Output tracingLinked list Output tracing
Linked list Output tracing
 
Va ha slant.ppt worked
Va ha slant.ppt workedVa ha slant.ppt worked
Va ha slant.ppt worked
 
Increasing and decreasing functions
Increasing and decreasing functionsIncreasing and decreasing functions
Increasing and decreasing functions
 

Viewers also liked

Viewers also liked (13)

2020 A
2020 A2020 A
2020 A
 
Electric Circuits Class (Solved problem set F)
Electric Circuits Class (Solved problem set F)Electric Circuits Class (Solved problem set F)
Electric Circuits Class (Solved problem set F)
 
8 dnv res0254-97 b)&c)
8 dnv res0254-97 b)&c)8 dnv res0254-97 b)&c)
8 dnv res0254-97 b)&c)
 
Tiyatro okullari-istanbul
Tiyatro okullari-istanbulTiyatro okullari-istanbul
Tiyatro okullari-istanbul
 
FRP防水工事
FRP防水工事FRP防水工事
FRP防水工事
 
保険コンサルティングのご提案
保険コンサルティングのご提案保険コンサルティングのご提案
保険コンサルティングのご提案
 
Norwegian
NorwegianNorwegian
Norwegian
 
9 rn9 variantepasocampanazárate
9 rn9 variantepasocampanazárate9 rn9 variantepasocampanazárate
9 rn9 variantepasocampanazárate
 
25 Fatwa Ulama Ahlus Sunnah Seri 2
25 Fatwa Ulama Ahlus Sunnah Seri 225 Fatwa Ulama Ahlus Sunnah Seri 2
25 Fatwa Ulama Ahlus Sunnah Seri 2
 
Arthur Yang - A1 Poster
Arthur Yang - A1 PosterArthur Yang - A1 Poster
Arthur Yang - A1 Poster
 
Jetstar in-asia
Jetstar in-asiaJetstar in-asia
Jetstar in-asia
 
Paulus Gunawan Subroto - Notaris & PPAT
Paulus Gunawan Subroto - Notaris & PPATPaulus Gunawan Subroto - Notaris & PPAT
Paulus Gunawan Subroto - Notaris & PPAT
 
Huraian tingkatan 3 Sejarah
Huraian tingkatan 3 SejarahHuraian tingkatan 3 Sejarah
Huraian tingkatan 3 Sejarah
 

Similar to EE693 DS & Algorithms Quiz Review

Ee693 sept2014midsem
Ee693 sept2014midsemEe693 sept2014midsem
Ee693 sept2014midsemGopi Saiteja
 
Ee693 sept2014quiz1
Ee693 sept2014quiz1Ee693 sept2014quiz1
Ee693 sept2014quiz1Gopi Saiteja
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanationsGopi Saiteja
 
Technical aptitude questions_e_book1
Technical aptitude questions_e_book1Technical aptitude questions_e_book1
Technical aptitude questions_e_book1Sateesh Allu
 
Ee693 questionshomework
Ee693 questionshomeworkEe693 questionshomework
Ee693 questionshomeworkGopi Saiteja
 
DSA (Data Structure and Algorithm) Questions
DSA (Data Structure and Algorithm) QuestionsDSA (Data Structure and Algorithm) Questions
DSA (Data Structure and Algorithm) QuestionsRESHAN FARAZ
 
designanalysisalgorithm_unit-v-part2.pptx
designanalysisalgorithm_unit-v-part2.pptxdesignanalysisalgorithm_unit-v-part2.pptx
designanalysisalgorithm_unit-v-part2.pptxarifimad15
 
Gssl
GsslGssl
Gsslncct
 
GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004Rohit Garg
 
Advanced data structures using c++ 3
Advanced data structures using c++ 3Advanced data structures using c++ 3
Advanced data structures using c++ 3Shaili Choudhary
 
Gate Previous Years Papers
Gate Previous Years PapersGate Previous Years Papers
Gate Previous Years PapersRahul Jain
 
PVEB Tree.pptx
PVEB Tree.pptxPVEB Tree.pptx
PVEB Tree.pptxSanthosh A
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
 
Ds qb 2021 rma
Ds qb 2021 rmaDs qb 2021 rma
Ds qb 2021 rmaARAVINDRM2
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithmK Hari Shankar
 
Redo midterm
Redo midtermRedo midterm
Redo midtermIIUM
 

Similar to EE693 DS & Algorithms Quiz Review (20)

Ee693 sept2014midsem
Ee693 sept2014midsemEe693 sept2014midsem
Ee693 sept2014midsem
 
Ee693 sept2014quiz1
Ee693 sept2014quiz1Ee693 sept2014quiz1
Ee693 sept2014quiz1
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanations
 
Technical aptitude questions_e_book1
Technical aptitude questions_e_book1Technical aptitude questions_e_book1
Technical aptitude questions_e_book1
 
Ee693 questionshomework
Ee693 questionshomeworkEe693 questionshomework
Ee693 questionshomework
 
DSA (Data Structure and Algorithm) Questions
DSA (Data Structure and Algorithm) QuestionsDSA (Data Structure and Algorithm) Questions
DSA (Data Structure and Algorithm) Questions
 
designanalysisalgorithm_unit-v-part2.pptx
designanalysisalgorithm_unit-v-part2.pptxdesignanalysisalgorithm_unit-v-part2.pptx
designanalysisalgorithm_unit-v-part2.pptx
 
Gssl
GsslGssl
Gssl
 
ELEMENTARY DATASTRUCTURES
ELEMENTARY DATASTRUCTURESELEMENTARY DATASTRUCTURES
ELEMENTARY DATASTRUCTURES
 
GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004
 
Advanced data structures using c++ 3
Advanced data structures using c++ 3Advanced data structures using c++ 3
Advanced data structures using c++ 3
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 
Gate Previous Years Papers
Gate Previous Years PapersGate Previous Years Papers
Gate Previous Years Papers
 
Gate-Cs 1993
Gate-Cs 1993Gate-Cs 1993
Gate-Cs 1993
 
PVEB Tree.pptx
PVEB Tree.pptxPVEB Tree.pptx
PVEB Tree.pptx
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
Recursive algorithms
Recursive algorithmsRecursive algorithms
Recursive algorithms
 
Ds qb 2021 rma
Ds qb 2021 rmaDs qb 2021 rma
Ds qb 2021 rma
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 

More from Gopi Saiteja

More from Gopi Saiteja (20)

Trees gt(1)
Trees gt(1)Trees gt(1)
Trees gt(1)
 
Topic11 sortingandsearching
Topic11 sortingandsearchingTopic11 sortingandsearching
Topic11 sortingandsearching
 
Heapsort
HeapsortHeapsort
Heapsort
 
Hashing gt1
Hashing gt1Hashing gt1
Hashing gt1
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Cs105 l15-bucket radix
Cs105 l15-bucket radixCs105 l15-bucket radix
Cs105 l15-bucket radix
 
Chapter11 sorting algorithmsefficiency
Chapter11 sorting algorithmsefficiencyChapter11 sorting algorithmsefficiency
Chapter11 sorting algorithmsefficiency
 
Sorting
SortingSorting
Sorting
 
Solution(1)
Solution(1)Solution(1)
Solution(1)
 
Pthread
PthreadPthread
Pthread
 
Open mp
Open mpOpen mp
Open mp
 
Introduction
IntroductionIntroduction
Introduction
 
Cuda
CudaCuda
Cuda
 
Vector space interpretation_of_random_variables
Vector space interpretation_of_random_variablesVector space interpretation_of_random_variables
Vector space interpretation_of_random_variables
 
Statistical signal processing(1)
Statistical signal processing(1)Statistical signal processing(1)
Statistical signal processing(1)
 
Prob review
Prob reviewProb review
Prob review
 
Estimationtheory2
Estimationtheory2Estimationtheory2
Estimationtheory2
 
Estimation theory 1
Estimation theory 1Estimation theory 1
Estimation theory 1
 
Before quiz 2
Before quiz 2Before quiz 2
Before quiz 2
 
Assignment for practice
Assignment for practiceAssignment for practice
Assignment for practice
 

Recently uploaded

Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfisabel213075
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 

Recently uploaded (20)

Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 

EE693 DS & Algorithms Quiz Review

  • 1. EE693 DATA STRUCTURES AND ALGORITHMS QUIZ-GT-1 EXAMINATION 14 OCTOBER, 2014, Time: 1 Hours EEE Department, IIT Guwahati NOTE: Attempt and solve all the questions. Question-1 to Question-10 are objective questions (only one choice is correct). Use of any kind of electronic media other than calculators are strictly prohibited. If anybody finds voiding this rule will be penalized with -10 marks penalty. Please do not forget to mention your Name and Roll No in the paper sheet. Please tick the correct choice. All the questions are of 2 marks. For any wrong answer penalty of -1 marks will be imposed. Name: Roll No: 1. This is the welcome question! All the best for EE693 Quiz-1 (GT). In a complete k-ary tree, every internal node has exactly k children or no child. The number of leaves in such a tree with n internal nodes is (a) nk (b) (n-1)k+1 (c) n(k-1)+1 (d) n(k-1) 2. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is: (a) 2h − 1 (b) 2(h−1) − 1 (c) 2(h+1) − 1 (d) 2 × (h + 1) 3. Postorder traversal of a given binary search tree, T produces the following sequence of keys 10, 9, 23, 22, 27, 25, 15, 50, 95, 60, 40, 29 Which one of the following sequences of keys can be the result of an in-order traversal of the tree T? (a) 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95 (b) 9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29 (c) 29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95 (d) 95, 50, 60, 40, 27, 23, 22, 25, 10, 9, 15, 29 4. Following function is supposed to calculate the maximum depth or height of a Binary tree – the number of nodes along the longest path from the root node down to the farthest leaf node. int maxDepth(struct node* node) { if (node==NULL) return 0; else { /* compute the depth of each subtree */ int lDepth = maxDepth(node->left); int rDepth = maxDepth(node->right); /* use the larger one */ if (lDepth > rDepth) return X; else return Y; } } (a) X = lDepth, Y = rDepth (b) X = lDepth + 1, Y = rDepth + 1 (c) X = lDepth - 1, Y = rDepth -1 (d) None of the above
  • 2. 5. Following is C like pseudo code of a function that takes a Queue as an argument, and uses a stack S to do processing. void fun(Queue *Q) { Stack S; // Say it creates an empty stack S // Run while Q is not empty while (!isEmpty(Q)) { // deQueue an item from Q and push the dequeued item to S push(&S, deQueue(Q)); } // Run while Stack S is not empty while (!isEmpty(&S)) { // Pop an item from S and enqueue the poppped item to Q enQueue(Q, pop(&S)); } } What does the above function do in general? (a) Removes the last from Q (b) Keeps the Q same as it was before the call (c) Makes Q empty (d) Reverses the Q 6. A priority queue can efficiently implemented using which of the following data structures? Assume that the number of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority item) operations are almost same. (a) Array (b) Linked List (c) Heap Data Structures (d) None of the above 7. A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below: 10, 8, 5, 3, 2 Two new elements "1" and "7" are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is: (a) 10, 8, 7, 5, 3, 2, 1 (b) 10, 8, 7, 2, 3, 1, 5 (c) 10, 8, 7, 1, 2, 3, 5 (d) 10, 8, 7, 3, 2, 1, 5 8. Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack? (a) A queue cannot be implemented using this stack. (b) A queue can be implemented where ENQUEUE takes a single instruction and DEQUEUE takes a sequence of two instructions. (c) A queue can be implemented where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction. (d) A queue can be implemented where both ENQUEUE and DEQUEUE take a single instruction each. 9. A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each node x. If the cost of computing g(x) is min{no. of leaf-nodes in left-subtree of x, no. of leaf-nodes in right-subtree of x} then the worst-case time complexity of the program is (a) Θ(n) (b) Θ(nLog(n)) (c) Θ(n2 ) (d) Θ(n2 Log(n)) 10. You are given the postorder traversal, P, of a binary search tree on the n elements 1,2,...,n. You have to determine the unique binary search tree that has P as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this? (a) O(Log(n)) (b) O(n) (c) O(nLog(n)) (d) None of the above All the best for next week quiz.