SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
EE693 DATA STRUCTURES AND ALGORITHMS
QUIZ-1 EXAMINATION
16 SEPTEMBER, 2014, Time: 1 Hours
EEE Department, IIT Guwahati
NOTE: Attempt and solve all the questions. Question-1 to Question-20 are multiple choice questions (more than one
choices may be correct). Question-1 to Question-20, marks will be awarded, if and only if, all the correct
choice(s) will be made. 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(s). All the questions are of 0.5
mark.
Name: Roll No:
1. This is the welcome question! All the best for EE693 Quiz-1.
There are 25 horses. At most, 5 horses can race together at a time. You must determine the fastest, second fastest,
and third fastest horses. The minimum number of races in which this can be done is
(a) 8 (b) 9 (c) 6 (d) 7
2. Given functions
f1(n) =
log n!
n
, f2(n) =
log n
log log n
,
f3(n) =
log (⌈log n⌉!)
log n
, f4(n) = log log n,
which among the following is correct?
(a) O(f2) ≤ O(f1) ≤ O(f3) ≤ O(f4)
(b) O(f3) ≤ O(f4) ≤ O(f2) ≤ O(f1)
(c) O(f4) ≤ O(f3) ≤ O(f2) ≤ O(f1)
(d) O(f2) ≤ O(f1) ≤ O(f4) ≤ O(f3)
3. Given two arrays, each containing n numbers already in sorted order, the time complexity of the fastest algorithm to
compute the median of all 2n elements is
(a) O(1) (b) O(n) (c) O(
√
n) (d) O(log n)
4. Which of the following sorting algorithms is not stable ?
(a) Merge Sort (b) Quick Sort (c) Counting Sort (d) Radix Sort
5. Solution to the recurrence T(n) = T(1
3
n) + T(2
3
n) + cn is
(a) Ω(n) (b) Ω(n2
) (c) Ω(n3
) (d) Ω(nlog n)
6. Solution to the recurrence T(n) = max0≤q≤n−1(T(q) + T(n − q − 1)) + cn is
(a) Ω(n2
) (b) Ω(nlog2
n) (c) Ω(nlog n) (d) Ω(n)
7. Suppose you flip a fair coin n times. The expected length of the longest streak of consecutive heads is
(a) Θ(n) (b) Θ(1) (c) Θ(log n) (d) Θ(
√
n)
8. What is the least number of comparisons required to find the maximum and minimum of a list of n numbers?
(a) n + ⌈log n⌉ − 2 (b) 3⌊n
2
⌋ (c) 2n − 3 (d) n + ⌊
√
n⌋ − 2
9. Find the worst inputs for Insertion Sort among the following:
(a) A =< 3,5,1,6,2,4 >
(b) A =< 6,4,5,3,1,2 >
(c) A =< 3,1,4,5,6,2 >
(d) A =< 6,4,2,5,3,1 >
10. Find the worst inputs for Merge Sort among the following:
(a) A =< 3,5,1,6,2,4 >
(b) A =< 6,4,5,3,1,2 >
(c) A =< 3,1,4,5,6,2 >
(d) A =< 6,4,2,5,3,1 >
11. Which of the following points is/are true about Linked List data structure when it is compared with array
(a) Arrays have better cache locality that can make them better in terms of performance.
(b) It is easy to insert and delete elements in Linked List.
(c) Random access is not allowed in a typical implementation of Linked Lists.
(d) The size of array has to be pre-decided, linked lists can change their size any time.
12. Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
(a) Insertion Sort (b) Quick Sort (c) Heap Sort (d) Merge Sort
13. In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
(a) log2n (b) n
2
(c) log2n − 1 (d) n
14. A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node
should p point such that both the operations enQueue and deQueue can be performed in constant time?
(a) rear node (b) front node (c) not possible with a single pointer (d) node next to front
15. Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in
sequence, and then perform n pop operations. Assume that Push and Pop operation take X seconds each, and Y
seconds elapse between the end of one such stack operation and the start of the next operation. For m >= 1, define
the stack-life of m as the time elapsed from the end of Push(m) to the start of the pop operation that removes m
from S. The average stack-life of an element of this stack is
(a) n(X+Y) (b) 3Y+2X (c) n(X+Y)-X (d) Y+2X
16. A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the
array. Variables top1 and top2 (topl<top2) point to the location of the topmost element in each of the stacks. If the
space is to be used efficiently, the condition for "stack full" is
(a) (top1 = MAXSIZE/2) and (top2 = MAXSIZE/2 + 1)
(b) top1 + top2 = MAXSIZE
(c) (top1 = MAXSIZE/2) or (top2 = MAXSIZE)
(d) top1 = top2 − 1
17. How many queues are needed to implement a stack. Consider the situation where no other data structure like arrays,
linked list is available to you.
(a) 1 (b) 2 (c) 3 (d) 4
18. Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are
distinct.
(a) Find the ith largest element
(b) Delete an element
(c) Find the ith smallest element
(d) All of the above
19. The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted
array of n integers is
(a) θ(n) (b) θ(logn) (c) θ(logn2
) (d) θ(n2
)
20. A program P reads in 500 integers in the range (0..100) representing the scores of 500 students. It then prints the
frequency of each score above 50. What would be the best way for P to store the frequencies?
(a) An array of 50 numbers
(b) An array of 100 numbers
(c) An array of 500 numbers
(d) A dynamically allocated array of 550 numbers
All the best for your mid-semester examinations.

Contenu connexe

Tendances

Lesson 5 interesting properties of complex conjugates p1 2
Lesson 5 interesting properties of complex conjugates p1 2Lesson 5 interesting properties of complex conjugates p1 2
Lesson 5 interesting properties of complex conjugates p1 2jenniech
 
Data sparse approximation of the Karhunen-Loeve expansion
Data sparse approximation of the Karhunen-Loeve expansionData sparse approximation of the Karhunen-Loeve expansion
Data sparse approximation of the Karhunen-Loeve expansionAlexander Litvinenko
 
Zero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical PhysicsZero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical PhysicsGunn Quznetsov
 
[Question Paper] Quantitative Technology (Revised Course) [September / 2013]
[Question Paper] Quantitative Technology (Revised Course) [September / 2013][Question Paper] Quantitative Technology (Revised Course) [September / 2013]
[Question Paper] Quantitative Technology (Revised Course) [September / 2013]Mumbai B.Sc.IT Study
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive modelsAkira Tanimoto
 
11 X1 T05 06 Line Through Pt Of Intersection
11 X1 T05 06 Line Through Pt Of Intersection11 X1 T05 06 Line Through Pt Of Intersection
11 X1 T05 06 Line Through Pt Of IntersectionNigel Simmons
 
Radix sort concept
Radix sort conceptRadix sort concept
Radix sort conceptZeeshan Ali
 
Chapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLABChapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLABPranoti Doke
 
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]Mumbai B.Sc.IT Study
 
Digital Signals and System (May – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (May  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (May  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (May – 2016) [Revised Syllabus | Question Paper]Mumbai B.Sc.IT Study
 

Tendances (19)

Mergesort
MergesortMergesort
Mergesort
 
Tot d lucas
Tot d lucasTot d lucas
Tot d lucas
 
OT
OTOT
OT
 
Lesson 5 interesting properties of complex conjugates p1 2
Lesson 5 interesting properties of complex conjugates p1 2Lesson 5 interesting properties of complex conjugates p1 2
Lesson 5 interesting properties of complex conjugates p1 2
 
Data sparse approximation of the Karhunen-Loeve expansion
Data sparse approximation of the Karhunen-Loeve expansionData sparse approximation of the Karhunen-Loeve expansion
Data sparse approximation of the Karhunen-Loeve expansion
 
Zero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical PhysicsZero. Probabilystic Foundation of Theoretyical Physics
Zero. Probabilystic Foundation of Theoretyical Physics
 
0406 ch 4 day 6
0406 ch 4 day 60406 ch 4 day 6
0406 ch 4 day 6
 
[Question Paper] Quantitative Technology (Revised Course) [September / 2013]
[Question Paper] Quantitative Technology (Revised Course) [September / 2013][Question Paper] Quantitative Technology (Revised Course) [September / 2013]
[Question Paper] Quantitative Technology (Revised Course) [September / 2013]
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
 
11 X1 T05 06 Line Through Pt Of Intersection
11 X1 T05 06 Line Through Pt Of Intersection11 X1 T05 06 Line Through Pt Of Intersection
11 X1 T05 06 Line Through Pt Of Intersection
 
Radix sort concept
Radix sort conceptRadix sort concept
Radix sort concept
 
0807 ch 8 day 7
0807 ch 8 day 70807 ch 8 day 7
0807 ch 8 day 7
 
Chapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLABChapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLAB
 
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (October  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (October – 2016) [Revised Syllabus | Question Paper]
 
Complex exercises
Complex exercisesComplex exercises
Complex exercises
 
Spsp fw
Spsp fwSpsp fw
Spsp fw
 
Lesson 51
Lesson 51Lesson 51
Lesson 51
 
Digital Signals and System (May – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (May  – 2016) [Revised Syllabus | Question Paper]Digital Signals and System (May  – 2016) [Revised Syllabus | Question Paper]
Digital Signals and System (May – 2016) [Revised Syllabus | Question Paper]
 
Week 13
Week 13Week 13
Week 13
 

En vedette

En vedette (20)

Tabla escepticismo y nihilismo
Tabla escepticismo y nihilismoTabla escepticismo y nihilismo
Tabla escepticismo y nihilismo
 
Office 2013
Office 2013Office 2013
Office 2013
 
What are our clients challenges
What are our clients challengesWhat are our clients challenges
What are our clients challenges
 
Diapositivas bienestar aprendices
Diapositivas bienestar aprendicesDiapositivas bienestar aprendices
Diapositivas bienestar aprendices
 
Our lady alliance academy final draft script: With Revisions
Our lady alliance academy final draft script: With RevisionsOur lady alliance academy final draft script: With Revisions
Our lady alliance academy final draft script: With Revisions
 
Photography and phot imaging
Photography and phot imagingPhotography and phot imaging
Photography and phot imaging
 
трансфузија крви 1
трансфузија крви 1трансфузија крви 1
трансфузија крви 1
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2
 
Documento recuperado 5
Documento recuperado 5Documento recuperado 5
Documento recuperado 5
 
Summary of Learning
Summary of LearningSummary of Learning
Summary of Learning
 
Ms excel
Ms excelMs excel
Ms excel
 
Commercial radio
Commercial radioCommercial radio
Commercial radio
 
RUBÉN. TERREMOTOS
RUBÉN. TERREMOTOSRUBÉN. TERREMOTOS
RUBÉN. TERREMOTOS
 
Varicela zorter virus
Varicela zorter virusVaricela zorter virus
Varicela zorter virus
 
Buenos días
Buenos díasBuenos días
Buenos días
 
Before quiz 2
Before quiz 2Before quiz 2
Before quiz 2
 
Ee693 sept2014midsem
Ee693 sept2014midsemEe693 sept2014midsem
Ee693 sept2014midsem
 
Tema i
Tema iTema i
Tema i
 
CIS Universidad César vallejo (CAMBIO CLIMÁTICO)
CIS Universidad César vallejo (CAMBIO CLIMÁTICO)CIS Universidad César vallejo (CAMBIO CLIMÁTICO)
CIS Universidad César vallejo (CAMBIO CLIMÁTICO)
 
Gaming industry
Gaming industryGaming industry
Gaming industry
 

Similaire à Ee693 sept2014quiz1

Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanationsGopi Saiteja
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Gopi Saiteja
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryMark Simon
 
Ee693 questionshomework
Ee693 questionshomeworkEe693 questionshomework
Ee693 questionshomeworkGopi Saiteja
 
Tpr star tree
Tpr star treeTpr star tree
Tpr star treeWin Yu
 
Amcat placement questions
Amcat placement questionsAmcat placement questions
Amcat placement questionsm4maths
 
Paper computer
Paper computerPaper computer
Paper computerbikram ...
 
Paper computer
Paper computerPaper computer
Paper computerbikram ...
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmEhsan Ehrari
 
Ip 5 discrete mathematics
Ip 5 discrete mathematicsIp 5 discrete mathematics
Ip 5 discrete mathematicsMark Simon
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexityshowkat27
 
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer key
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer keyNbhm m. a. and m.sc. scholarship test september 20, 2014 with answer key
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer keyMD Kutubuddin Sardar
 
pradeepbishtLecture13 div conq
pradeepbishtLecture13 div conqpradeepbishtLecture13 div conq
pradeepbishtLecture13 div conqPradeep Bisht
 
Classical programming interview questions
Classical programming interview questionsClassical programming interview questions
Classical programming interview questionsGradeup
 

Similaire à Ee693 sept2014quiz1 (20)

Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanations
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata Theory
 
Ee693 questionshomework
Ee693 questionshomeworkEe693 questionshomework
Ee693 questionshomework
 
Tpr star tree
Tpr star treeTpr star tree
Tpr star tree
 
algo1
algo1algo1
algo1
 
Amcat placement questions
Amcat placement questionsAmcat placement questions
Amcat placement questions
 
Paper computer
Paper computerPaper computer
Paper computer
 
Paper computer
Paper computerPaper computer
Paper computer
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in Algoritm
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Ip 5 discrete mathematics
Ip 5 discrete mathematicsIp 5 discrete mathematics
Ip 5 discrete mathematics
 
Sorting
SortingSorting
Sorting
 
Q
QQ
Q
 
Slide2
Slide2Slide2
Slide2
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
 
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer key
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer keyNbhm m. a. and m.sc. scholarship test september 20, 2014 with answer key
Nbhm m. a. and m.sc. scholarship test september 20, 2014 with answer key
 
pradeepbishtLecture13 div conq
pradeepbishtLecture13 div conqpradeepbishtLecture13 div conq
pradeepbishtLecture13 div conq
 
Classical programming interview questions
Classical programming interview questionsClassical programming interview questions
Classical programming interview questions
 

Plus de Gopi Saiteja

Plus de 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
 
Assignment for practice
Assignment for practiceAssignment for practice
Assignment for practice
 
After quiz 2
After quiz 2After quiz 2
After quiz 2
 

Dernier

Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
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
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
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
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
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
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
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
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptNoman khan
 
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
 
"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
 

Dernier (20)

Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
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
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
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
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
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
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).ppt
 
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
 
"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 ...
 

Ee693 sept2014quiz1

  • 1. EE693 DATA STRUCTURES AND ALGORITHMS QUIZ-1 EXAMINATION 16 SEPTEMBER, 2014, Time: 1 Hours EEE Department, IIT Guwahati NOTE: Attempt and solve all the questions. Question-1 to Question-20 are multiple choice questions (more than one choices may be correct). Question-1 to Question-20, marks will be awarded, if and only if, all the correct choice(s) will be made. 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(s). All the questions are of 0.5 mark. Name: Roll No: 1. This is the welcome question! All the best for EE693 Quiz-1. There are 25 horses. At most, 5 horses can race together at a time. You must determine the fastest, second fastest, and third fastest horses. The minimum number of races in which this can be done is (a) 8 (b) 9 (c) 6 (d) 7 2. Given functions f1(n) = log n! n , f2(n) = log n log log n , f3(n) = log (⌈log n⌉!) log n , f4(n) = log log n, which among the following is correct? (a) O(f2) ≤ O(f1) ≤ O(f3) ≤ O(f4) (b) O(f3) ≤ O(f4) ≤ O(f2) ≤ O(f1) (c) O(f4) ≤ O(f3) ≤ O(f2) ≤ O(f1) (d) O(f2) ≤ O(f1) ≤ O(f4) ≤ O(f3) 3. Given two arrays, each containing n numbers already in sorted order, the time complexity of the fastest algorithm to compute the median of all 2n elements is (a) O(1) (b) O(n) (c) O( √ n) (d) O(log n) 4. Which of the following sorting algorithms is not stable ? (a) Merge Sort (b) Quick Sort (c) Counting Sort (d) Radix Sort 5. Solution to the recurrence T(n) = T(1 3 n) + T(2 3 n) + cn is (a) Ω(n) (b) Ω(n2 ) (c) Ω(n3 ) (d) Ω(nlog n) 6. Solution to the recurrence T(n) = max0≤q≤n−1(T(q) + T(n − q − 1)) + cn is (a) Ω(n2 ) (b) Ω(nlog2 n) (c) Ω(nlog n) (d) Ω(n) 7. Suppose you flip a fair coin n times. The expected length of the longest streak of consecutive heads is (a) Θ(n) (b) Θ(1) (c) Θ(log n) (d) Θ( √ n) 8. What is the least number of comparisons required to find the maximum and minimum of a list of n numbers? (a) n + ⌈log n⌉ − 2 (b) 3⌊n 2 ⌋ (c) 2n − 3 (d) n + ⌊ √ n⌋ − 2 9. Find the worst inputs for Insertion Sort among the following: (a) A =< 3,5,1,6,2,4 > (b) A =< 6,4,5,3,1,2 > (c) A =< 3,1,4,5,6,2 > (d) A =< 6,4,2,5,3,1 >
  • 2. 10. Find the worst inputs for Merge Sort among the following: (a) A =< 3,5,1,6,2,4 > (b) A =< 6,4,5,3,1,2 > (c) A =< 3,1,4,5,6,2 > (d) A =< 6,4,2,5,3,1 > 11. Which of the following points is/are true about Linked List data structure when it is compared with array (a) Arrays have better cache locality that can make them better in terms of performance. (b) It is easy to insert and delete elements in Linked List. (c) Random access is not allowed in a typical implementation of Linked Lists. (d) The size of array has to be pre-decided, linked lists can change their size any time. 12. Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? (a) Insertion Sort (b) Quick Sort (c) Heap Sort (d) Merge Sort 13. In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is (a) log2n (b) n 2 (c) log2n − 1 (d) n 14. A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time? (a) rear node (b) front node (c) not possible with a single pointer (d) node next to front 15. Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Push and Pop operation take X seconds each, and Y seconds elapse between the end of one such stack operation and the start of the next operation. For m >= 1, define the stack-life of m as the time elapsed from the end of Push(m) to the start of the pop operation that removes m from S. The average stack-life of an element of this stack is (a) n(X+Y) (b) 3Y+2X (c) n(X+Y)-X (d) Y+2X 16. A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (topl<top2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for "stack full" is (a) (top1 = MAXSIZE/2) and (top2 = MAXSIZE/2 + 1) (b) top1 + top2 = MAXSIZE (c) (top1 = MAXSIZE/2) or (top2 = MAXSIZE) (d) top1 = top2 − 1 17. How many queues are needed to implement a stack. Consider the situation where no other data structure like arrays, linked list is available to you. (a) 1 (b) 2 (c) 3 (d) 4 18. Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct. (a) Find the ith largest element (b) Delete an element (c) Find the ith smallest element (d) All of the above 19. The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is (a) θ(n) (b) θ(logn) (c) θ(logn2 ) (d) θ(n2 ) 20. A program P reads in 500 integers in the range (0..100) representing the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies? (a) An array of 50 numbers (b) An array of 100 numbers (c) An array of 500 numbers (d) A dynamically allocated array of 550 numbers All the best for your mid-semester examinations.