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

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C

Department of Computer Science and Technology

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

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

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

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

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

CS302 Data Structures using C++

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

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

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

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

17CS33:Data Structures Using C QUESTION BANK

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))

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

VALLIAMMAI ENGINEERING COLLEGE

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

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

Data Structures Question Bank Multiple Choice

CS DATA STRUCTURES AND ALGORITHMS

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

1. Attempt any three of the following: 15

Sample Question Paper

CS301 - Data Structures Glossary By

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

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

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

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

MLR Institute of Technology

CS8391-DATA STRUCTURES

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

PESIT Bangalore South Campus Department of MCA Course Information for

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

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

CS 445: Data Structures Final Examination: Study Guide

CS 8391 DATA STRUCTURES

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

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

) $ f ( n) " %( g( n)

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

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.

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

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

DATA STRUCTURES THROUGH C++

March 20/2003 Jayakanth Srinivasan,

Computer Science Foundation Exam. Dec. 19, 2003 COMPUTER SCIENCE I. Section I A. No Calculators! KEY

CSE Data Structures and Introduction to Algorithms... In Java! Instructor: Fei Wang. Mid-Term Exam. CSE2100 DS & Algorithms 1

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

DATA STRUCTURES AND ALGORITHMS

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1

Basic Data Structures (Version 7) Name:

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

FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 ( Marks: 1 ) - Please choose one The data of the problem is of 2GB and the hard

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

Summer Final Exam Review Session August 5, 2009

Overview of Data Structures, Algorithm Analysis

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

Data Structure and Algorithm, Spring 2013 Midterm Examination 120 points Time: 2:20pm-5:20pm (180 minutes), Tuesday, April 16, 2013

Fundamentals of Data Structure

DEPARTMENT OF COMPUTER APPLICATIONS B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER LESSON PLAN SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Bharati Vidyapeeth s College Of Engineering for Women Pune-43 Department E & TC. SE- Unit Test I Subject-DS

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

Draw a diagram of an empty circular queue and describe it to the reader.

Final Examination CSE 100 UCSD (Practice)

Largest Online Community of VU Students

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

DS ata Structures Aptitude

Reg. No. : Question Paper Code : 27157

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

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

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

S.E. (Computer) (First Semester) EXAMINATION, 2011 DATA STRUCTURES AND ALGORITHM (2008 PATTERN) Time : Three Hours Maximum Marks : 100

TIME: 3 HOURS MARKS: a. Develop a java program to sort an array of N numbers in ascending order. (40)

LESSON PLAN B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER

DATA STRUCTURES AND ALGORITHMS

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

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

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

D. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.

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

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

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

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

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

CS 112 Final May 8, 2008 (Lightly edited for 2012 Practice) Name: BU ID: Instructions

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

Computer Science Engineering Sample Papers

( ) 1 B. 1. Suppose f x

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

Trees! Ellen Walker! CPSC 201 Data Structures! Hiram College!

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Heaps Outline and Required Reading: Heaps ( 7.3) COSC 2011, Fall 2003, Section A Instructor: N. Vlajic

12 Abstract Data Types

n 2 ( ) ( ) + n is in Θ n logn

I Year MCA I Semester L T P To C FOUNDATIONS OF INFORMATION TECHNOLOGY

Transcription:

Code No: R21051 R10 SET - 1 II B. Tech I Semester, Supplementary Examinations, May - 2012 DATA STRUCTURES (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 Answer any FIVE Questions All Questions carry Equal Marks *******-****** 1. a) Which of the given options provides the increasing order of asymptotic complexity of the n 3 / 2 functions: f 1, f 2, f3 and f 4? f1 ( n) = 2 f 2 ( n) = n f3 ( n) = nlog 2 n log 2 n f 4 ( n) = n b) i) Write a recursive C function to compute n Fibonacci numbers of the following: 1, if n = 0 f ( n) = 1, if n = 1 f ( n 1) + f ( n 2) f 7? ii) How many times f is called (including the first call) for an evaluation of ( ) 2. a) Consider an array: {25, 14, 16, 13, 10, 8, 12} represents a binary max-heap. What is the content of the array after two delete operations on a binary max-heap? b) Write a recursive quick sort algorithm. Trace the algorithm to sort the following elements: 72, 15, 22, 11, 18, 56, 40, 45 3. a) What is an equivalent infix form of the following postfix form of arithmetic expression? A B C C D E + / b) Let a circular queue is maintained in an array A[0..n-1]. What is the size of the queue in terms of F and R, where F, R indicate the FRONT and REAR indices? c) Write a C program to implement the circular queue operations using arrays. (3M+3M+9M) 4. a) Write a C program to create a doubly linked list and display all the elements in the list? b) Compare singly and doubly linked lists to perform insertion and operations. (8M+7M) 5. a) A complete n array tree is a tree in which each node has n children or no children. Let I be the number of internal nodes and L be the number of leaves in a complete n array tree. If L = 41and I = 10, then what is the value of n? b) Consider the following in-order and pre-order traversal of a binary tree. What is the postorder traversal of a binary tree? In-order Traversal: D B F E G H A C Pre-order raversal: A B D E F G H C 1 of 2

R10 SET - 1 6. a) What is a threaded binary tree? Explain with an example. b) The following numbers are inserted into an empty binary search tree in the given order one by one: 15, 32, 20, 9, 3, 25, 12, 1. i) Show the final binary search tree after the insertions. ii) Draw the binary search tree after deleting 15 from it. 7. a) Explain the graph traversal methods with suitable examples. b) How many minimum spanning trees does the following graph have? Draw all of them. 8. a) Explain the representation of sets using linked lists. b) What is an ADT? What are the ADT operations? Explain ADT implementation of a stack. 2 of 2

R10 SET - 2 II B. Tech I Semester, Supplementary Examinations, May - 2012 DATA STRUCTURES (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 Answer any FIVE Questions All Questions carry Equal Marks *******-****** 1. a) Find the values of f (513, 2) and f (345, 10) for the following recursive function definition: n n mod r + f, r, if n > 0 f ( n, r) = r 0, otherwise b) Write a recursive binary search algorithm. Trace the algorithm to search the element -5 in the list of elements: -5, -3, -1, 0, 10, 15, 20, 25 2. a) What is a natural merge sort? A natural merge sort is to be used to sort the file of integers: 12, 37, 42, 9, 5, 7, 50, 40, 45, and 92. What is the order of the numbers after one pass of the sort? b) Write a selection sort algorithm. Trace the algorithm to sort the following elements: 72, 15, 22, 11, 18, 56, 40, 45 3. a) What is an equivalent infix form of the following postfix form of arithmetic expression? + A B C D / E / F + G H, where represents exponentiation b) What is the minimum number of stacks of size n required to implement a queue of size n? Explain. c) Write a C program to convert an infix expression to a postfix expression. (3M+3M+9M) 4. a) What are the lists of operations that can be performed on a singly linked list? Explain how to perform insertion and deletion operations in the middle of a singly linked list. b) What is a circularly linked list? Write a C program to display the number of elements in a circularly linked list. 1 of 2

R10 SET - 2 5. a) What is the total number of distinct binary trees with n nodes? Draw all the distinct binary trees with 5 nodes. b) Consider the following weighted binary tree: i) What is the weighted external path length of the binary tree? ii) What is the weighted degree path length of the binary tree? 6. a) A binary search tree is generated by inserting in order of the integers: 50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24. What is the total number of nodes in the left sub-tree and the right sub-tree? b) What is a balanced binary tree? What is the maximum height of any balanced binary tree with 33 nodes? Assume that the height of a tree with a single node is 0. 7. a) Consider the graph, G with 12 edges. It has 6 vertices of degree 3 and the rest have degree less than 3. Determine the minimum number of vertices. b) Consider a weighted undirected graph with vertex set V = {a, b, c, d, e, f, g, h, i, j} and edge set E = {(a, b, 6), (a, c, 1), (a, d, 2), (a, e, 8), (b, d, 3), (b, g, 2), (c, d, 2), (d, h, 15), (e, f, 11), (e, h, 8), (e, i, 2), (f, h, 4), (f, i, 9), (g, h, 8), (g, i, 14), (g, j, 19), (h, i, 4), (i, j, 5)}. The third value in the tuple represents the weight of the edge specified in the tuple. What is the weight of a minimum spanning tree of the weighted undirected graph? 8. a) What is an ADT? What are the ADT operations? Explain ADT implementation of a queue. b) Explain the information storage using bit strings. (10 +5M) 2 of 2

R10 SET - 3 II B. Tech I Semester, Supplementary Examinations, May - 2012 DATA STRUCTURES (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 Answer any FIVE Questions All Questions carry Equal Marks *******-****** f 5861, 7 for the following recursive function definition: 0, x < y f ( x, y) = f ( x y, y) + 1, y x b) Write a recursive C function to solve the problem oftowers of Hanoi. Trace the C function for an optimal execution time of the Towers of Hanoi problem with n = 8 discs. 1. a) Find the value of ( ) 2. a) The elements 32, 15, 20, 30, 12, 25 and 16 are inserted one by one in the given order into MaxHeap. What is the resultant MaxHeap? b) Write a recursive quick sort algorithm. Trace the algorithm to sort the following elements: 25, 7, 34, 2, 70, 9, 61, 16, 49, 19 3. a) What is an equivalent infix form of the following postfix form of arithmetic expression? A B C C D E + / b) What is a priority queue? Explain with an example. c) Write a C program to implement the queue operations using stack. (3M+3M+9M) 4. a) What is a linked list? Explain the different types of linked lists. b) What is a sparse matrix? Write C program to add two sparse matrices using linked lists. 5. a) What is the total number of distinct binary trees with 12 nodes? b) Consider the following in-order and post-order traversal of a binary tree. What is the pre-order traversal of a binary tree? In-order Traversal: B C A E D G H F I Post-order Traversal: C B E H G I F D A 6. a) The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree? b) What is a balance factor of a binary tree? Mark the balance factor of each node of the following binary tree and state whether it is height balanced or not. 1 of 2

R10 SET - 3 7. Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the edge{ i, j}. 0 1 8 1 4 1 0 12 4 9 W = 8 12 0 7 3 1 4 7 0 2 4 9 3 2 0 i) What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T? ii) What is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges? 8. a) Explain the representation of sets using linked lists. b) What is an ADT? What are the ADT operations? Explain ADT implementation of a stack. 2 of 2

R10 SET - 4 II B. Tech I Semester, Supplementary Examinations, May - 2012 DATA STRUCTURES (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 Answer any FIVE Questions All Questions carry Equal Marks *******-****** 1. a) There are four different algorithms: A1, A2, A3, A4 to solve a given problem with the complexity n order: log n, log log 2 n, nlog 2 n, and respectively. What is the best algorithm? log 2 n Why? b) How many times f is called for an evaluation of f ( 95) in the following recursive function? n 10, if n > 100 f ( n) = f ( f ( n + 11) ), otherwise c) What is the average successful search time taken by binary search on a sorted array of 10 data items? (5M+5M+5M) 2. a) What is a randomized quick sort? Explain with an example. b) How many swapping are needed to sort the following numbers in ascending order using bubble sort? : 8, 22, 7, 9, 31, 19, 5, 13 c) If one uses straight two-way merge sort algorithm to sort the elements: 20, 47, 15, 8, 9, 4, 40, 30, 12, 17 in ascending order, and then what is the order of these elements after the second pass of the algorithm? (5M+5M+5M) 3. a) What is an equivalent infix form of the following postfix form of arithmetic expression? + A B C D / E / F + G H, where represents exponentiation b) If memory for the run time stack is only 150 cells (words), how big can n be in n! before encountering a stack overflow? c) Write a C program to implement the round-robin algorithm. Trace the program with an appropriate input data. (3M+3M+9M) 4. a) What is a circularly linked list? Write a C program to display the number of elements in a circularly linked list. b) What are the lists of operations that can be performed on a doubly linked list? Explain how to perform insertion and deletion operations in the middle of a doubly linked list. 1 of 2

R10 SET - 4 5. a) Compare trees and binary trees. b) The set: (A, (B, (E, F)), (C, (G)), (D, (H, I, J))) represents a tree. Find the number of leaf nodes in the binary tree representation of this tree. c) Consider a complete k array tree, where every internal node has exactly k children. What is the total number of leaves in such a tree with n internal nodes? (5M+5M+5M) 6. a) How many nodes will become unbalanced when a node is inserted as a child of the node G of the following balanced binary tree? b) A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are not? Explain. 7. a) If the simple graph G has n vertices and e edges, how many edges does the G, complement of G have? If the simple graph G has 15 edges and G has 13 edges, how many vertices does G have? b) A complete, undirected, weighted graph G is given on the vertex set {0, 1, 2,..., n-1}for any fixed n. Draw the minimum spanning tree of G if: i) The weight of the edge (u, v) is u v ii) The weight of the edge (u, v) is ( i ) 61 52 14 17 40 43 ( ii ) 2 3 50 40 60 43 ( iii ) 10 65 31 48 37 43 ( iv ) 81 61 52 14 41 43 ( v ) 17 77 27 66 18 43 u + v 8. a) Explain the information storage using bit strings. b) What is an ADT? What are the ADT operations? Explain ADT implementation of a queue. 2 of 2