Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above

Similar documents
R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

INSTITUTE OF AERONAUTICAL ENGINEERING

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks)

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

12 Abstract Data Types

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 154) Pass Marks: 24

Department of Computer Science and Technology

1. Two main measures for the efficiency of an algorithm are a. Processor and memory b. Complexity and capacity c. Time and space d.

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

Discuss the following operations on One-Dimensional array with algorithms.

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

Prepared By: Ms. Nidhi Solanki (Assist. Prof.) Page 1

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Data Structures Question Bank Multiple Choice

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

Overview of Data Structures, Algorithm Analysis

Course Name: B.Tech. 3 th Sem. No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours. Planned.

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

Topics. Trees Vojislav Kecman. Which graphs are trees? Terminology. Terminology Trees as Models Some Tree Theorems Applications of Trees CMSC 302

VALLIAMMAI ENGINEERING COLLEGE

Tribhuvan University Institute of Science and Technology Computer Science and Information Technology (CSC. 154) Section A Attempt any Two questions:

Visit ::: Original Website For Placement Papers. ::: Data Structure

CS 8391 DATA STRUCTURES

QUESTION BANK. Prepared by,mrs.d.maladhy AP/IT,RGCET. Page 1

CS8391-DATA STRUCTURES

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

GUJARAT TECHNOLOGICAL UNIVERSITY COMPUTER ENGINEERING (07) / INFORMATION TECHNOLOGY (16) / INFORMATION & COMMUNICATION TECHNOLOGY (32) DATA STRUCTURES

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

Chapter 4 Trees. Theorem A graph G has a spanning tree if and only if G is connected.

2. (a) Explain when the Quick sort is preferred to merge sort and vice-versa.

Second Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

ASSIGNMENTS. Progra m Outcom e. Chapter Q. No. Outcom e (CO) I 1 If f(n) = Θ(g(n)) and g(n)= Θ(h(n)), then proof that h(n) = Θ(f(n))

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0301. Subject Name: Data Structure. B.Tech. Year - II

Stacks, Queues and Hierarchical Collections

CS301 - Data Structures Glossary By

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

Data Structure. IBPS SO (IT- Officer) Exam 2017

Formal Languages and Automata Theory, SS Project (due Week 14)

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH DEGREE EXAMINATION, JULY 2017 CS205: DATA STRUCTURES (CS, IT)

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

DS ata Structures Aptitude

Algorithms and programs, basic idea of pseudo-code.algorithm efficiency and analysis, time and space analysis of algorithms order notations.

DATA STRUCTURE. 1- What data structure can be used to check if a syntax has balanced paranthesis? A - queue B - tree C - list D - stack

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1

17CS33:Data Structures Using C QUESTION BANK

S.Y. B.Sc. (IT) : Sem. III. Data Structures

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1

MLR Institute of Technology

Recitation 9. Prelim Review

Course Review for Finals. Cpt S 223 Fall 2008

Multiple Choice Question. Unit-1 Introduction

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

DEEPIKA KAMBOJ UNIT 2. What is Stack?

10 MCQ of Data Structure Paper-2(CS/IT) For NIC SSC Scientific Assistant IBPS IT Officer Exam 2017

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο

Revision Statement while return growth rate asymptotic notation complexity Compare algorithms Linear search Binary search Preconditions: sorted,

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Introduction and Overview

Where does the insert method place the new entry in the array? Assume array indexing starts from 0(zero).

DATA STRUCTURES AND ALGORITHMS

ROOT: A node which doesn't have a parent. In the above tree. The Root is A.

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

CS521 \ Notes for the Final Exam

Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each

( ) n 3. n 2 ( ) D. Ο

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

Computer Science E-22 Practice Final Exam

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w

a) State the need of data structure. Write the operations performed using data structures.

n 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο

( D. Θ n. ( ) f n ( ) D. Ο%

U IT I FIFO, i F r t s n I i F r t s u O t . I L FO S r a t p i o nt r e R pop S c a s k fr n o t . l a f o h t e b a o e S c a k S c a k

Data Structures Brett Bernstein

Computer Science 302 Spring 2017 (Practice for) Final Examination, May 10, 2017

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Postfix (and prefix) notation

Section 5.5. Left subtree The left subtree of a vertex V on a binary tree is the graph formed by the left child L of V, the descendents

DESIGN AND ANALYSIS OF ALGORITHMS

9. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally likely.)

Data Structure using C++ Lecture 04. Data Structures and algorithm analysis in C++ Chapter , 3.2, 3.2.1

Data Structures. Trees. By Dr. Mohammad Ali H. Eljinini. M.A. Eljinini, PhD

Lec 17 April 8. Topics: binary Trees expression trees. (Chapter 5 of text)

CS302 Data Structures using C++

DATA STRUCTURES AND ALGORITHMS

Binary Trees, Binary Search Trees

Sample Question Paper

Info 2950, Lecture 16

PESIT Bangalore South Campus Department of MCA Course Information for

Transcription:

Data Structures 1. Each entry in a linked list is a called a --------- (a)link (b)node (c)data structure (d)none of the above 2. Linked list uses type of memory allocation (a)static (b)dynamic (c)random (d)compile time 3. The functions used for memory allocation (a)malloc (b)calloc (c)a and b (d)none of the above 4. Which of the following is primitive type? (a)string (b)integer (c)float (d)b and c 5. The five items: A, B, C, D and E are pushed in a stack, one after the other starting from A. The stack is popped four times and F is pushed on the stack. Now one item is popped from the stack. The popped item is. (a)a (b)b (c)c (d)f 6. What is the value of the postfix expression 6 3 2 4 + - * (a)something between -15 and -100 (b)something between -5 and -15 c)something between 5 and -5 (d)none of the above 7. Determine the value of the following postfix expressions when the variables have the values: A=2, B=3, C=4 and D=5 AB*C-D+ (a)-7 (b)3 (c)7 (d)-3 8. Convert the infix expression A*B-(C+D)+E into postfix form (a)ab*cd+-e+ (b)ab*cd-+e+ (c)abcd*-+e+ (d)none of the above 9. When topological sort cannot be performed on graphs? (a) acyclic graph (b) cyclic graphs weighted graph (d) none of these 10. Dijkstra s algorithm is used to determine the shortest path between to in a weighted digraph. (a) the first vertex, last vertex (b) source vertex, other vertices the first vertex, second vertex (d) none of these 11. Which type of algorithmic technique is used in Dijkstra s algorithm? (a) divide and conquer (b) Greedy algorithm Backtracking (d) none of these 12. Topological sort is. (a) one of the sorting method (b) ordering of vertices ordering of numbers (d) none of these 13. Which data structure is used in dfs? a) stack b) queue c)linked list d)tree

14. Which data structure is used in bfs? a) stack b) queue c)linked list d)tree 15. Which is the phenomenon which occurs when a hash function maps 2 different keys to the same table address? a) Collision b) Overlaps c) Nothing Happens d) Rebound 16. Which one is not divide and conquer algorithm a) merge sort b) quick sort c) bubble sort d) binary search 17. The average case time complexity of quick sort is. a. O(n) b.o(n 2 ) c. O(nlogn) d. None of these 18. The worst case time complexity of binary search is. a. O(logn) b.o(n 2 ) c. O(nlogn) d. None of these 19. Write the expression for the expression tree a) (a+b*c)+((d*e+f)*g) b) (a+b)*c+((d*e+f)*g) c) (a+b)*c+(d*(e+f)*g) d) (a+b*c)+d*(e+f*g) 20. The prefix notation for the expression tree is a) + + a * b c * + * d e f g b) + a * + b c * + * d e f g c) + + a * b c * + d * e f g d) + + a * b c + * * d e f g

21. Which one of the following is used in the implementation of tree? a) stack b) queue c)array d)linked list 22. The algorithm works by dividing an input array into two halves, sorting them recursively and then merging the two sorted halves to get the original array sorted. a) heap sort b) quick sort c) merge sort d) selection sort 23. ------------------- is a divide and conquer algorithm that works by partitioning its input elements according to their values relative to some pre selected element. a) heap sort b) quick sort c) merge sort d) selection sort 24. The selection of pivot element is used in ----------------- a) heap sort b) quick sort c) merge sort d) selection sort 25. Which one of the following is not an internal sorting? a) heap sort b) quick sort c) poly phase merge d) selection sort 26. Which data structure is used in implementing towers of Hanoi? a) stack b)queue c) linked list d)tree 27. Which one of the following is an application of stack? a) infix to postfix conversion b) printers c) ticket reservation d) minimum spanning tree 28. Which one of the following algorithm is used to find the minimum spanning tree? (a) prim s algorithm (b) dijkstra s algorithm (c) knapsack (d) none of the above 29. Which one of the following algorithm is used to find the single source shortest path problem? (a) prim s algorithm (b) dijkstra s algorithm (c) knapsack (d) none of the above 30. What is the minimum spanning tree of the following graph? Which one of the following is true? (a) Kruskal Algorithm looks easier than Prim s (b) Kruskal Algorithm is harder to implement than prim s ( c) Kruskal Algorithm is less efficient than prim s (d) All the above 31. The running time of Kruskals algorithm is (a) Θ (log n) (b) Θ (n log m) (c) Θ (n2) (d) Θ(m log m)

32. ------------------is a method for efficiently solving a broad range of search and optimization problems which exhibit the characteristics of overlapping sub problems and optimal substructure. (a) branch and bound (b) backtracking (c) dynamic programming (d) greedy 33. Two main measures for the efficiency of an algorithm are a. Processor and memory b. Complexity and capacity c. Time and space d. Data and space 34. Which of the following data structure is linear data structure? a. Trees b. Graphs c. Arrays d. None of above 35. How many different binary search trees can be made from three nodes that contain the key values 1, 2,3 & 4? a) 12 b)13 c)14 d)15 36. Which of the following name does not relate to stacks? a. FIFO lists b. LIFO list c. Piles d. Push-down lists 37. The term "push" and "pop" is related to the a. array b. lists c. stacks d. all of above 38. A data structure where elements can be added or removed at either end but not in the middle a. Linked lists b. Stacks c. Queues d. Dequeue 39. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return a. FAEKCDBHG b. FAEKCDHGB c. EAFKHDCBG d. FEAKDCHBG 40. What is the data structures used to perform recursion? a. Linked lists b. Stacks c. Queues d. Dequeue 41. A binary tree with 20 nodes has null branches? a)19 b)20 c)21 d)22 42. How many different trees are possible with 10 nodes? a) 1014 b)1024 c)1034 d)none of the above 43. There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree? a)12 b)13 c)15 d)14 44. There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a complete binary tree? a)12 b)13 c)15 d)14 45. Minimum number of queues needed to implement the priority queue? a)1 b)2 c)3 d)none of the above

46. If n denotes the number of vertices in the given graph, then How many edges we have in the minimum spanning tree? (a) n (b) n-1 (c) n+1 (d)none of the above 47. The following tree is A. Heap B. Full & Complete C. Heap & Complete D.None of these 48. How many binary search trees can be constructed with 5 nodes? 40 42 44 46 49. Binary trees with 20 nodes have ----- null branches? 19 21 20 400 50. BFS of the following graph leads to (a) a b c d e f g h b) a b d c g e f h (c ) a b d e h c f g (d) a b d e h c g f 51. Traverse the graph and give the post order result? (a) D H B E A F C I G J (B) A B D H E C F G I J (C ) H D E B F I J G C A (D) H E D F B J I C G A

52. Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent Prefix and Postfix notations. a. Prefix Notation: - +ABC *^ - DE + FG Postfix Notation: AB + C * DE - FG + ^ - b. Prefix Notation: - * +ABC ^ DE + - FG Postfix Notation: AB + C * DE - FG + ^ - c. Prefix Notation: - * +ABC ^ - DE + FG Postfix Notation: AB + C * DE - FG + ^ - d. Prefix Notation: - * +ABC ^ - DE + FG Postfix Notation: AB + C * DE - FG + - ^ 53. Sorting is not possible by using which of the following methods? a. Insertion b. Selection c. Exchange d. Deletion 54. Consider the following pseudo code that uses a stack declare a stack of characters while ( there are more characters in the word to read ) { read a character push the character on the stack } while ( the stack is not empty ) { pop a character off the stack write the character to the screen } What is output for input geeksquiz? (A) geeksquizgeeksquiz (B) ziuqskeeg (C) geeksquiz (D) ziuqskeegziuqskeeg 55. Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced: declare a character stack while ( more input is available) { read a character if ( the character is a '(' ) push it on the stack else if ( the character is a ')' and the stack is not empty ) pop a character off the stack else print "unbalanced" and exit } print "balanced" Which of these unbalanced sequences does the above code think is balanced? (A) ((( )) (B) ( ))(( ) (C) (( )( ))) (D) (( )))( ) 56. The following postfix expression with single digit operands is evaluated using a stack:

8 2 3 ^ / 2 3 * + 5 1 * - Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are: (A) 6, 1 (B) 5, 7 (C) 3, 2 (D) 1, 5 57. Assume that the operators +, -, are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x, +, -. The postfix expression corresponding to the infix expression a + b c - d ^ e ^ f is (A) abc + def ^ ^ (B) abc + de ^ f ^ (C) ab + c d e ^ f ^ (D) + a bc ^ ^ def 58. Given a Binary Search Tree (BST), print its values in ascending order. a. Perform Depth first traversal b. Perform Breadth first traversal c. Perform Post order traversal d. Perform In order traversal 59. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the post order traversal sequence of the same tree? (A) 10, 20,15, 23, 25,35, 42,39,30 (B) 15,10, 25, 23, 20, 42,35,39,30 (C) 15, 20,10, 23, 25, 42,35,39,30 (D) 15,10, 23, 25, 20,35, 42,39,30 60. Suppose a circular queue of capacity (n 1) elements is implemented with an array of N elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are (A) full: (REAR+1) mod n==front empty: REAR ==FRONT (B) full:(rear+1)mod n==front empty: (FRONT+1)mod n==rear (C) full: REAR==FRONT empty: (REAR+1) mod n ==FRONT (D) full: (FRONT+1)mod n==rear empty: REAR ==FRONT 61. A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?

62. Consider two binary operators ' ' and ' ' with the precedence of operator being lower than that of the operator. Operator is right associative while operator, is left associative. Which one of the following represents the parse tree for expression