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

Similar documents
Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

PES Institute of Technology-BSC QUESTION BANK

10CS35: Data Structures Using C

DATA STRUCTURES USING C

Data Structure [Question Bank]

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: )

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

Exam study sheet for CS2711. List of topics

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

Data Structures. Level 6 C Module Descriptor

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

Sample Questions Csci 1112 A. Bellaachia

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

BCS2B02: OOP Concepts and Data Structures Using C++

Unit Write iterative and recursive C functions to find the greatest common divisor of two integers. [6]

Algorithms and Data Structures

International Journal of Software and Web Sciences (IJSWS)

Atmiya Infotech Pvt. Ltd. Data Structure. By Ajay Raiyani. Yogidham, Kalawad Road, Rajkot. Ph : ,

Converting a Number from Decimal to Binary

To My Parents -Laxmi and Modaiah. To My Family Members. To My Friends. To IIT Bombay. To All Hard Workers

Any two nodes which are connected by an edge in a graph are called adjacent node.

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Lab Manual. Data Structures (Pr): COT-213 Data Structures (P): IT-215

Binary Search Trees CMPSC 122

AP Computer Science AB Syllabus 1

Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am-12:10pm (180 minutes), Friday, November 12, 2010

Data Structure with C

Java Software Structures

Algorithms and data structures

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R

Binary Heap Algorithms

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Module 2 Stacks and Queues: Abstract Data Types

Data Structures and Algorithms Written Examination

Objected oriented Programming: C++ Unit 1 1. Introduction 1.1. Introduction to Object Oriented Programming C++ fundamentals.

Bangalore University B.Sc Computer Science Syllabus ( Semester System)

Syllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System

Social Media Mining. Graph Essentials

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

University of Pune Revised Structure for the B. Sc. (Computer Science) Course (Second Year to be implemented from Academic Year )

Introduction to Data Structures

MAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push)

CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues. Linda Shapiro Spring 2016

Data Structures. Chapter 8

Mathematics for Algorithm and System Analysis

Linked Lists, Stacks, Queues, Deques. It s time for a chainge!

CompSci-61B, Data Structures Final Exam

Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 13-1

Data Structures and Algorithms V Otávio Braga

Data Structures Fibonacci Heaps, Amortized Analysis

Warshall s Algorithm: Transitive Closure

COMPUTER SCIENCE. Paper 1 (THEORY)

Symbol Tables. Introduction

Chapter 13 Disk Storage, Basic File Structures, and Hashing.

Chapter 13. Disk Storage, Basic File Structures, and Hashing

Data Structures and Data Manipulation

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011

DATABASE DESIGN - 1DL400

A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION

AFF 808. Sub. Code 4BIT1C1. B.Sc. DEGREE EXAMINATION, NOVEMBER First Semester. Information Technology

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING LESSON PLAN

CHAPTER 4 ESSENTIAL DATA STRUCTRURES

ML for the Working Programmer

FOPR-I1O23 - Fundamentals of Programming

Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)

MapReduce and Distributed Data Analysis. Sergei Vassilvitskii Google Research

CSE 326: Data Structures B-Trees and B+ Trees

root node level: internal node edge leaf node Data Structures & Algorithms McQuain

Chapter 13: Query Processing. Basic Steps in Query Processing

Chapter 3: Restricted Structures Page 1

Binary Trees and Huffman Encoding Binary Search Trees

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

Heaps & Priority Queues in the C++ STL 2-3 Trees

Fast Sequential Summation Algorithms Using Augmented Data Structures

Introduction to Programming System Design. CSCI 455x (4 Units)

From Last Time: Remove (Delete) Operation

Chapter 8: Structures for Files. Truong Quynh Chi Spring- 2013

Scalable Prefix Matching for Internet Packet Forwarding

Data Structures, Practice Homework 3, with Solutions (not to be handed in)

Data Structures and Algorithm Analysis (CSC317) Intro/Review of Data Structures Focus on dynamic sets

Lecture 1: Data Storage & Index

CS5310 Algorithms 3 credit hours 2 hours lecture and 2 hours recitation every week

A Fast Algorithm For Finding Hamilton Cycles

Persistent Binary Search Trees

Common Data Structures

Ordered Lists and Binary Trees

Assessment Plan for CS and CIS Degree Programs Computer Science Dept. Texas A&M University - Commerce

Chapter 13. Chapter Outline. Disk Storage, Basic File Structures, and Hashing

- Easy to insert & delete in O(1) time - Don t need to estimate total memory needed. - Hard to search in less than O(n) time

Data Structures in Java. Session 15 Instructor: Bert Huang

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2)

Glossary of Object Oriented Terms

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

CS 2302 Data Structures Spring 2015

Transcription:

Second Semester [MCA] MAY-JUNE 2006 Subject: Data Structure Time: 3 Hours Maximum Marks: 60 Note: Question 1. is compulsory and is of 20 marks. Attempt one out of two questions from remaining four units. All questions in units are of 10 marks each. Q. 1 (a) Differentiate between the terms variable and parameter. (b) Determine the length and number of substring of string THREAD. A* (B + C) * D/E. (c) Find the number of elements in the array A (1:8, -5:5, -10:5). Which will be the first and the last element of this array (d) When is a link list better than arrays. (e) Why infix expressions are converted into postfix expressions. (f) Circular Queues is better than linear queues. Justify the statement. (g) A given binary search tree is to be sorted. Which traversal method should be applied? (h) Why searching is easier in sorted list. (i) Discuss any one hash function. (j) What is a B-tree? Q. 2 (a) Given a linear sorted array having N elements and that it can store MAX elements. Write an algorithm to insert the contents of ITEM into it. (b) Consider a linked list defined by START. It has a node with address P. Write an algorithm to split it into two link lists one starting with START and second has P as into first node. Q. 3 (a) The element of a binary tree. A B C D E F G Have to be stored in an array. Write the desired algorithm. Te output should also indicate number of elements in the tree.

(b) Find the path matrix using WARSHALL algorithm for the graph G. G A B G D C Q. 4 (a) Given list of numbers arranged in the form of linear array 44, 33, 11, 51, 77, 90, 99, 22. Using quick sort algorithm find the element of the array when 44 is set it position. Also discuss the status of STACK. (b) Given the sorted list in the form of linear arrays having N and M elements. Write an algorithm to MERGE these lists into a single sorted list. The name of the elements these are repeated is to be enumerated. Q. 5 (a) What is file organization? Why it is needed. Discuss in detail sequential file organization with its MERITS and DEMERITS. UNIT III Q. 6 Write an algorithm to convert a given infix expression into an equivalent portfolio expression. Illustrate the working of the algorithm on the following infix expression. ((8*7) + 4) * (7+9)/6-10 Q. 7 Describe any two of the following algorithms: (a) Kruskal s Algorithm (b) Shell Sort (c) Polyphone Merge sort ----------------------------------

Second Semester [MCA] MAY 2005 Time: 3 Hours Maximum Marks: 60 Q. 1 (a) Define B-Tree (b) Convert following infix expression into prefix and postfix A* (B + C) * D/E. (c) Give the difference between external and internal sorting. Give names of some external sorting techniques. (d) Define stack and give some application s of stacks. (e) How many nodes are there on level I of a binary tree? Prove the answer. (f) Define transitive closure of a graph. (g) Define inverted files. (h) Describe adjacency list representation of graph with the help of an example. (i) Give two examples of Hash function. (j) Give difference between complete and full binary tree. UNIT - I Subject: Data Structure Note: Question 1. is compulsory and is of 20 marks. Attempt one out of two questions from remaining four units. All questions in units are of 10 marks each. Q. 2 How polynomial are represented using linked list. Write program for addition of two polynomials represented using linked list. Q. 3 Explain with the help of algorithm how infix expression converted to postfix expression using stack. UNIT - II Q. 4 Write Prim s algorithm for finding minimum cost spanning tree. Show its working on a graph. Q. 5 Explain how trees can used for representation of disjoint sets. Explain Union of find operations on these sets. UNIT - III Q. 6 Explain Merge sort algorithm and show its working on following members 4, 10, 2, 6, 8, 12, 5, 7

Q. 7 What is hashing? What are various types of Hash functions? What are various methods of collision resolution? UNIT - IV Q. 8 What do you mean by file organization? Explain various file organization techniques. Q. 9 Write short notes on any two of the following Index techniques (d) Cylinder surface indexing (e) Hashed Indexes (f) Tree indexing. ----------------------------------

Second Semester [MCA] MAY 2004 Time: 3 Hours Maximum Marks: 60 Note: Attempt any five questions. Subject: Data Structure Q. 1 (a) What is difference between Big-O and Small-O notation. Define them. 4 (b) Give an example of algorithm that has following complexity (in terms of Big-O). 4 (i) O (1) (ii) O(N) (iii) O (N 2 ) (iv) O (n log n) (c) Algorithm 1 does a particular task in time N 3 where N is no. of elements processed. Algorithm 2 does same task in time 3N + 1000. 4 (i) What are Big-O requirement of each algorithm. (ii) Under what conditions, if any, would the less efficient algorithm executes more quickly than more efficient algorithm? Q. 2 (a) Write a procedure to print elements of a singly linked list in reverse order while traversing it only once. 6 (b) Let a queue be implemented as a circular linked structure with an external pointer accessing the rear element: 6 (i) Draw a sketch of such a queue with one node. (ii) Write a algorithm for insertion and deletion. Q. 3 (a) Write an algorithm to implement selection sort. 7 (b) Sort the following numbers (Showing each iteration) using 5 Quick Sort :- 57, 73, 43, 77, 83, 63, 87. Q. 4 Write a algorithm to convert infix expression to postfix expression using stack. Also, write an algorithm to evaluate postfix expression. 12 Q. 5 Define sparse matrix. Implement sparse matrix as an array. Give an algorithm to transpose a sparse matrix for this implementation. 12 Q. 6 (a) What do you mean by file organization? Differentiate between sequential, hashed and random file organization. 6 (b) What is aim of hashing? What are different hashing techniques? What are the problems encountered in them and how to overcome them. 6

Q. 7 (a) Write a algorithm for topological sort of a graph. 7 (b) Taking an example of a graph. Show how breadth first search operates on this graph. 5 Q. 8 Write short notes on any three of the following :- 3 x 4 (a) Balanced Merge sort (b) Critical path (c) B + tree (d) B-tree --------------------------

Second Semester [MCA] MAY 2003 Time: 3 Hours Maximum Marks: 60 Note: Attempt any five questions. Subject: Data Structures Q. 1 (a) Explain why there might be tradeoffs between saving computer (Execution) time and saving programming time. 3 (b) Explain the difference between sequential array based representation and linked representation of a list with examples. 4 (c) Explain the difference between internal and external sorting with example. 3 (d) Define Big-O notation. 2 Q. 2 (a) Write a procedure in C/C++ to add two single variable polynomial using linked list. 7 (b) Write an algorithm that implement insertion and deletion operation on circular queue. 5 Q. 3 (a) Formulate an algorithm to implement insertion sort. 6 (b) Derive time complexities for insertion sort, quick sort, and selection sort. 6 Q. 4 (a) Define B-Tree. What is the difference B-Tree and B + -Tree. 5 (b) Construct an AVL tree in which element are inserted in following order : 72, 44, 100, 200, 30, 57, 10 5 (c) What is difference between tree, binary tree and a graph? 2 Q. 5 Write a non-recursive algorithm for preorder traversal of a tree. Give example also. 12 Q. 6 (a) Write an algorithm to implement breadth first search for a graph. 6 (b) Taking an example of graph, show how depth first search operates on the graph. 12 Q. 7 What is sparse matrix? Implement sparse matrix as an array. Give an algorithm to add and subtract two sparse matrices for this implementation. 6 Q. 8 Write short notes on any three of the following :- 12 (a) Polyphase mergesort. (b) Search Tree (c) Inverted Tree (d) Hashing -----------------------------------

Second Semester [MCA] JUNE 2001 Time: 3 Hours Maximum Marks: 70 Note: Attempt any five questions. Subject: Data Structures Q. 1 (a) Write a routine, which reads the matrix, If non-zero elements are less than 25% of total elements, it converts this matrix to SPARSE matrix representation. 7 (b) What is advantage of circular queues over queues? Write add & delete routine for it. 7 Q. 2 (a) Differentiate between tree and binary tree. 4 (b) Write a module for insertion of node t as right child of s in threaded binary tree. Clearly explain its working using a suitable binary tree. 10 Q. 3 (a) Write a routine for traversal of singly linked list without using any additional node. 9 (b) What do you mean by dynamic memory allocation? In which cases, it is used. 5 Q. 4 (a) Write PUSH & POP routines for linked stack. 6 (b) How do you determine run-time of algorithms? Give an example of O (n log n). 5 (c) Define generalized lists. 3 Q. 5 (a) Assume that we have a sorted array of elements in descending order. Can binary search algorithm still be implemented on it? If yes, write the modified algorithm. If not, justify why not? 7 (b) If a list is already sorted in descending order, how fast will be insertion sort for ascending? Clearly explain. 7 Q. 6 (a) For an undirected graph G with n vertices & e edges, show that 6 n d 1 = 2 e where d 1 = degree of vertex i. i =1 (b ) By considering the complete graph with n vertices, show that no. of spanning trees is atleast 2 n-1 1. 8

Q. 7 (a) Write an algorithm to insert a new key value X into a tree in which the keys are sampled from left to right, one character at a time. 7 (b) Define and explain inverted files. 7 Q. 8 (a) How overflow is handled in hashing. 10 (b) Define and explain cellular partitioning. 4 ------------------------------------

Second Semester [MCA] AUGUST 2000 Subject: Data Structure Time: 3 Hours Maximum Marks: 70 Note: Attempt four questions in all, including Q. No. 1, which is compulsory. Q. 1 (a) What do you mean by data structure? Explain with the help of two examples. 3 (b) What do you mean by complexity of an algorithm? Explain with an example.3 (c) Define a Binary Search tree. Draw the expression tree for the following: x : = (a<b) or (e < f) 3 (d) Determine the order in which the vertices of following binary tree will be visited in post order traversal. 1 3 2 3 5 4 6 (e) Write a function in C that will count the number of nodes in linked binary tree. 5 (f) Convert following INFIX expression to POSTFIX expression A+ (B*C) * (D + E) * F 2 (g) Give the average case and worst case complexity for the following algorithm (i) Selection Sort (ii) Quick Sort 4 (h) Define AVL tree. Convert the following into an AVL tree. 4 7 (i) 1 (ii) 1 2 2 3 3 5 4

(i) Describe briefly sequential file organization with an example. 3 (j) What is the difference between internal and external sort. 2 (k) Write a function in C to delete a node, different from first and last node, from a linked list. 4 (l) Give the node structure of a binary search tree. Using it write a recursive function to traverse a tree in preorder. 4 Q. 2 Give the array implementation of the stack. Write function for pushing and poping elements from a stack. 10 Q. 3 Draw a binary search tree when the keys arrive in the given order. 10 p, x, b, e, a, c, f, y, q, r Delete the nodes containing the keys in the following order a, e, x Q. 4 Describe the heap sort method for sorting the following list 10 15, 16, 13, 19, 5, 7, 4, 18 Show the result of the intermediate steps also. Q. 5 (a) For the following digraph 7 1 4 2 3 5 Obtain the transitive closure. Give the steps for finding the transitive closure. (b) Write a recurrence relation for obtaining n th terms of the Fibonacci series. 3 Q. 6 Write a program in C to implement depth-first traversal of a graph. 10 Q. 7 Define a B-tree. Draw a B-tree of order 5 when the keys arrive in the following order. a, f, g, b, h, d, j, m, s, e, r, i, e, x, n, l, u, t, p and then delete the keys in the reverse order of arrival. 10 Q. 8 Give the array implementation of a circular queue. Write functions in C to insert and delete an element from circular queue. 10 --------------------------------------