1 views

Uploaded by Dinesh Bhawnani

© All Rights Reserved

- Assignment 1
- Data Structure -3
- micro-bit lesson 2 plan
- Extractor in R_3 and Delta Queue
- CS 439 2011 Fall Final Soln
- Crypto keys
- Problem Solving and Program Design
- Transportation Problem solved
- 10 Lessons of an MIT Education
- Algorithm (documentation for project)demo
- The Many Faces of PublishSubscribe
- elk-20-5-8-1012-945
- 14_Sameer Sharma_FinalPaper
- Mathematicians
- mode5
- Model
- Msri Presentation
- Bpl
- dsa1
- Httpwww Wi Pb Edu Plplikinaukazeszytyz9oniszczuk-Full

You are on page 1of 5

Unit Test : DATA STRUCTURE

Time: 00:30 Hour M.M. : 40

______________________________________________________________________________

INSTRUCTIONS: Attempt all the 20 questions. Each question carry two marks.

Algo example A, n

{

if (n = = 1)

return A

m = n/2

return example (A, m)* example (A, n–m)

}

(a) 1 (b) log n (c) n (d) O(n log n)

i= y

While i 1 do

begin

if (y%i 0) & & x%i 0 & & i%2 0

then

output i

i = i –1

end

What will be the output when x 24 and y = 18

(a) 6, 2 (b) 2, 6 (c) 2, 4 (d) 6, 4

2

3. Consider the algorithm 1 that takes 3N 2N 1 time to solve a problem and algorithm 2 that takes 10N 1

time to solve the same problem under what conditions if any so that the “less” efficient algo executes faster

than the “ more” effficient algorithm.

(a) N 2 (b) N 2 (c) N 3 (d) N 3

4. If we have a list of 25 elements and we wish to find the minimum and maximum number simultaneously then

Total number of comparision using iterative method = A

Minimum number of comaparisions required for above problem = B.

Then value of A and B are

(a) 36, 36 (b) 49, 36 (c) 48, 36 (d) 36, 48

(a) log n (b) log log n (c) n log n (d) n log log n

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com

B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

2

6. Suppose the fibonacci number F11 = 89 and F12 = 144, then the value of F16 = ?

(a) 377 (b) 610 (c) 987 (d) 233

7. The complexity of below recurrence:

2T n 1 1 if n 0

Tn

1 otherwise

(a) O(1) (b) O(n) (c) O(logn) (d) O(n2)

8. The minimum number of queue of size ‘n’ required to implement a stack of size ‘n’?

(a) one (b) two (c) three (d) four

9. Consider the following program

void Abrakadabra (int n)

{

if (n < 2) return;

else counter = 0’,

for (int i = 0; i < 32; i++)

Abrakadabra (n/4);

for (int j = 0; j < 32; i++)

Abrakadabra (n/4);

for (int i = 0; i < n4; i++)

counter ++;

}

(a) O(n3) (b) O(n4) (c) O(n3 log n) (d) O(n4 log n)

10. Assume that the operators +, –, × are left associative and is right associative. The order of precedence

(from highest to lowest) is , , , – . The postfix expression corresponding to the infix expression

a + b + c – def is:

(a) abc def (b) abc de f (c) ab c d d f (d) None of these

5T n 1 if n 1

(A) T n

1 If n 1

P. n

1

3

(B) T n T n – 1 n 2 n 1 Q. n

3

n

(C) T n 2T 1 R. n log n

8

(D) T n 2T n log n S. 5

n

(a) A-P, B-Q, C-R, D-S, E-T (b) A-Q, B-P, C-S, D-R, E-T

(c) A-S, B-Q, C-P, D-R, E-T (d) A-S, B-Q, C-P, D-T, E-R

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com

B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

3

x 1;

i 1;

while x 1000

begin

x 2x ;

i i 1 ;

end

What is the value of ‘i’ at the end of the pseudo code

(a) 4 (b) 5 (c) 6 (d) 8

13. Suppose ‘c’ is an integer greater than 1, and some function ‘f’ is defined such that f 0 f 1 1 . Which of

the following statement must not be true

n

(a) If f n f c then f n O log n (b) If f n c * f n 2 then f n O c n

2

n

(c) If f n c * f then f n O n log c (d) None of these

2

14. For each non-negative integer n, let Rn be the greatest possible number of regions into which the plane can be

partitioned by n straight lines. For example R0 =1 and R1 = 2. Then Rn has order

(a) n (b) n log n (c) 2n (d) n 2

15. If the expression 2 3 *4 5* 6 7 *8 9 is evaluated with * having precedence over +. Then the

value obtained is the same as the value of which of the following prefix expressions.

(a) + + * + 234 * * 5 + 6789 (b) + * + * 234 * * 5 + 6789

(c) * + + 234 * * 5 + + 6789 (d) * + + + 234 * * 5 + 6789

16. Which of the following expression evaluates to the largest number

(a) The prefix expression + * – 2357 (b) The postfix expression 2 3 + 5 * 7–

(c) The infix expression (2+3) * (5–7) (d) The postfix expression 2 3 + 5 7–*

17. Suppose we have 2n disks of only black or white colour. They are arranged as follows.

We want to arrange them in such a way that all the white disk are on the left side and all the black disks are on

the right side as follows

n n

(a) 2n (b) n (c) (d)

2 4

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com

B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

4

18. What is the maximum number of parenthesis that appear on the stack at any time when the algorithm analyzes

(( ( ( ) ( ( ) ) ( ( ) ) ) for balance parenthesization.

(a) 5 (b) 2 (c) 3 (d) 4

19. What does the following code fragment do

Queue q

q.enqueue (0);

q.enqueue(1);

for(i = 0; i<10; i++)

{

a =q.dequeue();

b=q.dequeue();

q.enqueue(b);

q.enqueue(a+b)

printf(“%d”, a)

}

(b) Print 0, 1, 1, 2, 3, 5, 8, 13, .................

(c) Print the first 10 fibunacci numbers

(d) None of these

20. What does the following code fragment do.

stack s //assume queue is not empty and stack is empty.

Queue q

while(!q.isEmpty())

s.push(q.dequeue());

while(!s.isEmtpy())

q.enqueue(s.pop());

(a) swap the item of queue and stack.

(b) reverse the items of queue

(c) reverse the items of stack.

(d) None of these

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com

B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

5

Unit Test : DATA STRUCTURE

8. (a) 9. (d) 10. (d) 11. (d) 12. (b) 13. (d) 14. (d)

15. (a) 16. (b) 17. (c) 18. (a) 19. (c) 20. (b)

H.O.: 28-A/11, Jia Sarai, Near-IIT, New Delhi-16 , Ph : 011-26851008, 26861009 www.careerendeavour.com

B.O.: 16, 3rd Floor, Mall road, G.T.B. Nagar (Metro Gate No. 3), Delhi-110 009, Ph: 011-65462244, 9540292991

- Assignment 1Uploaded byGroshanlal
- Data Structure -3Uploaded bySurendra Singh Chauhan
- micro-bit lesson 2 planUploaded byapi-380052821
- Extractor in R_3 and Delta QueueUploaded bymsg2dp
- CS 439 2011 Fall Final SolnUploaded bybrunosipod
- Crypto keysUploaded bymarkmcwilliams
- Problem Solving and Program DesignUploaded byNick Rush
- Transportation Problem solvedUploaded byVivek Singh
- 10 Lessons of an MIT EducationUploaded byMark Danzen
- Algorithm (documentation for project)demoUploaded bysocial servant
- The Many Faces of PublishSubscribeUploaded byJean Poul
- elk-20-5-8-1012-945Uploaded bym_adnane_dz3184
- 14_Sameer Sharma_FinalPaperUploaded byiiste
- MathematiciansUploaded byajnuaravind9160
- mode5Uploaded byJoris Mosheuvel
- ModelUploaded byJoris Mosheuvel
- Msri PresentationUploaded bygsg001
- BplUploaded byMjeriteljX
- dsa1Uploaded byRavi Singh
- Httpwww Wi Pb Edu Plplikinaukazeszytyz9oniszczuk-FullUploaded byKhoa Nguyen Dang
- Scimakelatex.6727.Greenlinery.codeneryUploaded byramrayssablue
- 02 03 3 Shortest Path LP Formulation Problem and SolutionUploaded bys
- Search ListUploaded byMahidhara Subrahmanya Sarma
- Chapter 1- Sahar PPTUploaded byMelissa Nunez
- adversarUploaded byNam Nguyen
- Module 1Uploaded byramones123345
- down and in callUploaded byapi-288731726
- final prezUploaded byapi-266877289
- MotivationUploaded bykarthickklr32
- Application of HMMUploaded byapi-3747254

- CS.pdfUploaded byrajesh
- DBMSUploaded byDinesh Bhawnani
- lab 6Uploaded byDinesh Bhawnani
- 23 to 45 LecturesUploaded byDinesh Bhawnani
- Data StoresUploaded byArnaldo Gomes
- Toc for GateUploaded byDinesh Bhawnani
- dms.pdfUploaded byDinesh Bhawnani
- 1 to 24 ddbsUploaded byMuhammad Ahmed
- BCA-503Uploaded byPrabhat Kumar
- ST1.pdfUploaded byDinesh Bhawnani
- Object Oriented Programming in CUploaded byumesh_ladha
- LinuxUploaded byDinesh Bhawnani
- Data Structure for GATEUploaded byDinesh Bhawnani
- Use Case DiagramsUploaded bydinudineshbhawnani2916
- SQL Query Interview QuestionsUploaded byDinesh Bhawnani

- Networking AssignmentUploaded byHarsimar Singh Gulati
- Information Systems in Global Business Today (Chapter One)Uploaded byprojects_masterz
- Intro ERP Using GBI Notes SD en v3.0Uploaded byAgenttZeeroOutsider
- Air Supported StructureUploaded bysuhruda
- Low Level ProgrammingUploaded byKarel Brg
- EES Newsletter Summer 2012-LibreUploaded byDejuan Huff
- The Fuel Cell Industry Review 2017Uploaded byStuart Jones
- Consumer innovativeness and its relationship with consumer attitude towards space tourism: A study.Uploaded byBabu George
- w2l Manual EnUploaded byAnna Jaruga
- timefullfouraucallsemUploaded byKoushani Banerjee
- webuser-may-4-20164246.pdfUploaded bydinesh
- Past Paper 1Uploaded byMohamad Shaheen
- Manual 18Uploaded byGeorge
- Elastopir PDF EnUploaded bypauldasman1
- Ekistics QuestionsUploaded byAshwin Kanodia
- Application letterUploaded byIvan Tiu Bautista
- Oracle Database 11g New Features for Administrators DBA Release 2_D50081GC20_1080544_USUploaded byJinendraabhi
- PM Design MoldabilityUploaded byMelisa Estes
- Torchmate CAD 5 GuideUploaded byJuanLuisIglesias
- Chapter 11Uploaded bysteves0118
- Qt Windows PluginUploaded byNicolaFrosi
- Multiple Object Tracking Using CAMShiftUploaded byAnjar Triyoko
- 077-En Cranes Mobile06Uploaded byxxsh
- V.R-Solid waste--28.10.13.pptUploaded byRamalingam Varadarajulu
- 582_Password Based Door Lock System Using 8051 MicrocontrollerUploaded byDaniel Kassaw
- Matthew Carpenter s Resume 2016Uploaded byMatthew Carpenter
- Business Events News for Thu 20 Oct 2016 - BESydney, Raffles Singapore, Pan Pacific rewards, JTB, CINZ, Decorative Events and Exhibitions, Young MEA, AMEX, Tourism Australia and moreUploaded byBusiness Events News
- It essential chapter 15 and 16Uploaded bytahsin69
- Noti_D2DEngg_2011Uploaded byNirav Patel
- SCWI Re-Exam PkgUploaded byKishorsing Rajput