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

Similar documents
March 20/2003 Jayakanth Srinivasan,

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

12 Abstract Data Types

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Sample Question Paper

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

Binary Trees, Binary Search Trees

University of Palestine. Final Exam 2 nd semester 2014/2015 Total Grade: 50

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

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

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

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

F453 Module 7: Programming Techniques. 7.2: Methods for defining syntax

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

Name CPTR246 Spring '17 (100 total points) Exam 3

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

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

TREES. Trees - Introduction

Introduction to Computers and Programming. Concept Question

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

1. Stack overflow & underflow 2. Implementation: partially filled array & linked list 3. Applications: reverse string, backtracking

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

Tree. Virendra Singh Indian Institute of Science Bangalore Lecture 11. Courtesy: Prof. Sartaj Sahni. Sep 3,2010

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

17CS33:Data Structures Using C QUESTION BANK

Trees. (Trees) Data Structures and Programming Spring / 28

CSI33 Data Structures

Largest Online Community of VU Students

Data Structure Advanced

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

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

Stacks, Queues and Hierarchical Collections

Cpt S 122 Data Structures. Course Review Midterm Exam # 1


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

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

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

CE 221 Data Structures and Algorithms

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

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

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

Algorithms and Data Structures Exercise I

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

CSCI-401 Examlet #5. Name: Class: Date: True/False Indicate whether the sentence or statement is true or false.

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

Data Structures and Algorithms for Engineers

Friday, March 30. Last time we were talking about traversal of a rooted ordered tree, having defined preorder traversal. We will continue from there.

Stack. 4. In Stack all Operations such as Insertion and Deletion are permitted at only one end. Size of the Stack 6. Maximum Value of Stack Top 5

CSI33 Data Structures

Data Structures Question Bank Multiple Choice

INSTITUTE OF AERONAUTICAL ENGINEERING

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

There are many other applications like constructing the expression tree from the postorder expression. I leave you with an idea as how to do it.

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

STACKS AND QUEUES. Problem Solving with Computers-II

PA3 Design Specification

6-TREE. Tree: Directed Tree: A directed tree is an acyclic digraph which has one node called the root node

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

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees

Stacks. Chapter 5. Copyright 2012 by Pearson Education, Inc. All rights reserved

Recursive Data Structures and Grammars

ECE Spring 2018 Problem Set #0 Due: 1/30/18

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

Course Review for. Cpt S 223 Fall Cpt S 223. School of EECS, WSU

Associate Professor Dr. Raed Ibraheem Hamed

Some Applications of Stack. Spring Semester 2007 Programming and Data Structure 1

Chapter Summary. Introduction to Trees Applications of Trees Tree Traversal Spanning Trees Minimum Spanning Trees

3137 Data Structures and Algorithms in C++

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

CS DATA STRUCTURES AND ALGORITHMS

Introduction. Problem Solving on Computer. Data Structures (collection of data and relationships) Algorithms

Course Review for Finals. Cpt S 223 Fall 2008

Tree: non-recursive definition. Trees, Binary Search Trees, and Heaps. Tree: recursive definition. Tree: example.

Upcoming ACM Events Linux Crash Course Date: Time: Location: Weekly Crack the Coding Interview Date:

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

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

The Stack and Queue Types

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

Advanced Java Concepts Unit 5: Trees. Notes and Exercises

8. Write an example for expression tree. [A/M 10] (A+B)*((C-D)/(E^F))

Department of Computer Science and Technology

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

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

DC104 DATA STRUCTURE JUNE Q.2 a. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

Tree. A path is a connected sequence of edges. A tree topology is acyclic there is no loop.

DEEPIKA KAMBOJ UNIT 2. What is Stack?


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

Trees, Binary Trees, and Binary Search Trees

Chapter 20: Binary Trees

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

MLR Institute of Technology

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

Introduction to Binary Trees

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

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

Adapted By Manik Hosen

Also, recursive methods are usually declared private, and require a public non-recursive method to initiate them.

CS301- Data Structures LATEST SOLVED MCQS & SUBJECTIVE FROM MIDTERM PAPERS. 18 December 2014

Trees. Trees. CSE 2011 Winter 2007

Transcription:

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms.... Q1) What are some of the applications for the tree data structure? Q2) There are 8, 15, 13, and 14 nodes in 4 different trees. Which one of them can form a full binary tree?. Q3) Draw the expression tree of the following infix expression. Convert it in to Prefix and Postfix expressions.. Q4) Assume that a queue is available for pushing and popping elements. Given an input sequence a, b, c, give the output sequence of elements if the rightmost element given above is the first to be popped from the queue.. Q5) A queue is a, (A) FIFO (First In First Out) list. (C) Ordered array. (B) LIFO (Last In First Out) list. (D) Linear tree... Q6) How many nodes in a tree have no ancestors. (A) 0 (B) 1 (C) 2 (D) n

Q7) What is an algorithm? What are the characteristics of a good algorithm?.. Q8) What is a Binary Search Tree (BST)? Make a BST for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48 Q9) What are expression trees? Represent the following expression using a tree. (a b ) / ( ( c * d ) + e)) Q10) Taking a suitable example explains how a general tree can be represented as a Binary Tree.. Q11) Reverse the order of elements on a stack S by using two additional stacks.. Q12) Explain how to implement two stacks in one array A[1..n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. The PUSH and POP operations should run in O(1) time. Q.13) Two Binary Trees are similar if they are both empty or if they are both nonempty and left and right sub trees are similar. Write an algorithm to determine if two Binary Trees are similar. Q.14) Construct a binary tree whose nodes in inorder and preorder are given as follows: Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50 Preorder: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50. Q15). Define a stack. Describe ways to implement stack.

.. Q16). Consider the algebraic expression E = (5x+z) (3a-b) 2, Draw the expression tree corresponding to E.. Q17) Consider the following eight numbers 50, 33, 44, 22, 77, 35, 60 and 40. Display the construction of the binary by inserting the above numbers in the given order.. Q18) Consider the following sixteen numbers 9, 5, 13, 3, 7, 11, 15, 2, 4, 6, 8, 10, 12, 14, 16 and 1. Display the construction of the binary by inserting the above numbers in the given order. Q19). What is a Binary Search Tree (BST)? a) Make a BST for the following sequence of numbers: 45, 32, 90, 21, 78, 65, 87, 132, 90, 96, 41, 74, 92 b) Traverse the created Binary Search Tree above in Preorder, Inorder and Postorder. 20) Which data structure is used to perform recursion?. 21) In this question, we consider logic expressions with the following operands and operators: Operands: 0 and 1, which represents false and true, respectively. Operators: & (and), (or), and! (not). The precedences of the three operators are:! > & >. Draw the logical expression tree of the expression!(((0&!1)&0) 0)&0. Since! (not) is an unary operator, we ask you to put its only operand to its right child..

22) A stack is to be implemented using an array. The associated declarations are: int stack [100]; int top = 0; Give the statement to perform push operation... 23) What is the maximum possible number of nodes in a binary tree at level 6?. 24) What is the prefix form of A-B/ (C * D ^ E),. 25) What is the equivalent prefix expression for the following infix expression (A+B)-(C+D*E)/F*G. 26) Given a set of input representing the nodes of a binary tree, write a non recursive algorithm that must be able to output the three traversal orders. Write an algorithm for checking validity of the input, i.e., the program must know if the input is disjoint, duplicated and has a loop... 27) What are the different ways of representing a graph? Represent the following graph using those ways.

. 28) Reverse the order of elements on a stack S (i) using two additional stacks. (ii) using one additional queue... 29) Write an algorithm to test whether a Binary Tree is a Binary Search Tree. Q30) Give the adjacency matrix for the following graph:. Q31) Given the following inorder and preorder traversal reconstruct a binary tree. Inorder sequence D, G, B, H, E, A, F, I, C Preorder sequence A, B, D, G, E, H, C, F, I.. Q32) What do you understand by tree traversal? Write a procedure for traversing a binary tree in preorder and execute it on the following tree.

.. Q33) Define adjacency matrix and make the same for the following undirected graph... Q34) Construct the binary tree for the following sequence of nodes in preorder and inorder respectively. Preorder : G, B, Q, A, C, K, F, P, D, E, R, H Inorder: Q, B, K, C, F, A, G, P, E, D, H, R (4). Q35) Draw a picture of the directed graph specified below: G = ( V, E) V(G) = {1, 2, 3, 4, 5, 6} E(G) = {(1,2), (2, 3), (3, 4), (5,1), (5, 6), (2, 6), (1, 6), (4, 6), (2, 4)} Obtain adjacency matrix for the above graph:.. Q36) Consider the following eight numbers 50, 33, 44, 22, 77, 35, 60 and 40. Display the construction of the binary by inserting the above numbers in the given order. Q37) Give the adjacency matrix and adjacency list of the following graphs.

. Q38) What are common operations that can be performed on a data-structure?.. Q39) See the below image of a binary search tree, and traverse it using all available methods Q40) Consider the following 2-3 tree. Draw the modified tree resulting in inserting 14.

. Please read all questions carefully before answering them. Good luck!