MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Similar documents
12 Abstract Data Types

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

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

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

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

Data Structures. Outline. Introduction Linked Lists Stacks Queues Trees Deitel & Associates, Inc. All rights reserved.

Largest Online Community of VU Students

Binary Trees, Binary Search Trees

Department of Computer Science and Technology

Abstract Data Structures IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

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

CS301 - Data Structures Glossary By

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

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

Summer Final Exam Review Session August 5, 2009

Stacks, Queues and Hierarchical Collections

Chapter 20: Binary Trees

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

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

Data Structures Question Bank Multiple Choice

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

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

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

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

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

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

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

CSI33 Data Structures

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

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

CS 8391 DATA STRUCTURES

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

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

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

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

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

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

Algorithms and Data Structures

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

Binary Trees

CP2 Revision. theme: dynamic datatypes & data structures

CS8391-DATA STRUCTURES

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

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?

Copyright 1998 by Addison-Wesley Publishing Company 147. Chapter 15. Stacks and Queues

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

Final Exam Data Structure course. No. of Branches (5)

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

Programming II (CS300)

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?

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

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

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

This examination has 11 pages. Check that you have a complete paper.

Data Abstractions. National Chiao Tung University Chun-Jen Tsai 05/23/2012

CE 221 Data Structures and Algorithms

TREES. Trees - Introduction

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

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

Data Structure Advanced

17CS33:Data Structures Using C QUESTION BANK

Fundamentals of Data Structure

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

9/26/2018 Data Structure & Algorithm. Assignment04: 3 parts Quiz: recursion, insertionsort, trees Basic concept: Linked-List Priority queues Heaps

Data Structure (CS301)

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

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

3137 Data Structures and Algorithms in C++

ECE250: Algorithms and Data Structures Midterm Review

Cpt S 122 Data Structures. Data Structures Trees

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

A. Year / Module Semester Subject Topic 2016 / V 2 PCD Pointers, Preprocessors, DS

namibia UniVERSITY OF 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.

Computer Science 302 Spring 2007 Practice Final Examination: Part I

CS 216 Exam 1 Fall SOLUTION

1 P age DS & OOPS / UNIT II

Answers. 1. (A) Attempt any five : 20 Marks

CSCE 2014 Final Exam Spring Version A

Topic 14. The BinaryTree ADT

Linked List. April 2, 2007 Programming and Data Structure 1

Programming II (CS300)

Dynamic Data Structures

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

Linear Structures. Linear Structure. Implementations. Array details. List details. Operations 2/10/2013

Topic Binary Trees (Non-Linear Data Structures)

Data Structure Lecture#10: Binary Trees (Chapter 5) U Kang Seoul National University

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

March 20/2003 Jayakanth Srinivasan,

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

Course Review for Finals. Cpt S 223 Fall 2008

CS 206 Introduction to Computer Science II

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

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

DS ata Structures Aptitude

BRONX COMMUNITY COLLEGE of the City University of New York DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE. Sample Final Exam

Transcription:

STUDENT IDENTIFICATION NO MULTIMEDIA COLLEGE JALAN GURNEY KIRI 54100 KUALA LUMPUR FIFTH SEMESTER FINAL EXAMINATION, 2014/2015 SESSION PSD2023 ALGORITHM & DATA STRUCTURE DSEW-E-F-2/13 25 MAY 2015 9.00 AM 11.00 AM (2 HOURS) INSTRUCTIONS TO STUDENT 1. This Question paper consists of ELEVEN (11) printed pages only. 2. This question paper consists of THREE (3) sections. Section A: Answer ALL questions. Section B: Answer ALL questions. Section C: Answer ALL questions. 3. Please write all your answers in the Answer Booklet provided.

SECTION A : OBJECTIVE QUESTIONS (20 MARKS) INSTRUCTION : ANSWER ALL QUESTIONS. 1. is a model of a data structure that specifies the type of data stored, the operations supported on them, and the types of parameters of the operations but not the implementation. A. Primitive data type B. Abstract data type C. Data structure D. Sequential list 2. The process of retrieving the top element of a stack is referred to as A. push B. pop C. peek D. empty 3. Which of the following is the characteristic of a circular linked list: A. The null pointer at the end of the list replaced with a pointer to the beginning of the list B. Its nodes has two links to the next and previous nodes C. It has an empty header node D. It allows data about circles and links to be stored 4. Which of the following is TRUE about queues? i. A queue is referred to as a LIFO data structure ii. It is a type of list iii. The method to removed data from a queue known as dequeue A. i, ii and iii B. i and iii C. ii and iii D. ii only SFCS Page 2 of 11

5. Which of the following features is related to encapsulation? A. Classes contain both data members and member functions. B. Abstract base class contains pure virtual functions. C. is-a relationship of classes. D. Class template describes a class in terms of a data-type parameter. 6. In a binary search tree, which traversal algorithm will cause the data in the tree to be processed in sorted order? A. inorder B. preorder C. postorder D. None of the above 7. 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 8. Finding the location of the element with a given value is: A. Traversal B. Search C. Sort D. None of the above 9. The operation of processing each element in the list is known as. A. sorting B. merging C. inserting D. traversal SFCS Page 3 of 11

10. Which of the following statements about binary trees is NOT true? A. Every binary tree has at least one node. B. Every non-empty tree has exactly one root node. C. Every node has at most two children. D. Every non-root node has exactly one parent. 11. The insertion of an element into a stack must do from where? A. On the top of the stack. B. In the middle of the stack. C. On the bottom of the stack. D. In any empty spot of a stack. 12. Stack is also called as. A. Last in First out B. First in Last out C. Last in Last out D. First in First out 13. is the term used to delete an element from the stack. A. Push B. Pull C. Pop D. Pump 14. Which of the following accurately illustrates Linked List? A. The last node is linked to the header B. Implementation of a Linked List is FIFO C. The list is linked to another list D. The data are stored in a collection of nodes. Each node contains data and a link to the next node. SFCS Page 4 of 11

15. Which of the following are linear types of data structure? i. Linked list ii. Stack iii. Binary Tree iv. Queue A. i, iii and iv only B. ii, iii and iv only C. i, ii and iv only D. i, ii, iii and iv 16. The pointer to the beginning of the list is known as. A. ADT B. pointer C. head pointer D. node 17. Deletion operation is done using in a queue. A. front B. rear C. top D. list 18. There are five items: 1, 2, 3, 4, and 5 are pushed into a stack, one after another starting from 1. The stack is popped out four times and each element is inserted in a queue. Then, two elements are deleted from the queue and pushed back into the stack. Now one item is popped from the stack. The popped item is? A. 5 B. 2 C. 3 D. 4 SFCS Page 5 of 11

19. The postfix form of A*B+C/D is A. *AB/CD+ B. AB*CD/+ C. A*BC+/D D. ABCD+/* 20. Which of the following are the sequences of steps for a postorder traversal of a tree? i. Process the value in the node. ii. Traverse the left subtree postorder. iii. Traverse the right subtree postorder. A. i, ii, iii B. ii,i, iii C. iii, i, ii D. ii, iii, i SFCS Page 6 of 11

SECTION B : TRUE (T) OR FALSE (B) (20 MARKS) INSTRUCTION : ANSWER ALL QUESTIONS. 1. Graph is a linear data structure. 2. The data structure used by recursion is stack. 3. Queue works on the strategy First in First out. 4. The name of a constructor is the same as the name of the class. 5. A constructor without parameters is called the normal constructor. 6. The public members of a class are not accessible outside the class. 7. By default, all members of a class are private. 8. Pointer variables contain the addresses of other variables as their values. 9. A single linked list can be traversed in either direction. 10. In a linked list, nodes can be inserted either at the beginning, middle or the end of list. 11. By using a data structure, programmers can hide implementation details of program codes from the user. 12. Flowchart is an English-like representation of the code required for an algorithm. 13. With an ADT, users are not concerned with what the task is done; rather, they need to be concerned only with how it can do. 14. The last element in the queue is called null. SFCS Page 7 of 11

15. Middle element in a queue can be accessed. 16. In postfix notations, the operator comes after the operands. 17. A linked list is a linear collection of self-referential structures, called nodes, connected by pointer links hence, the term "linked" list. 18. Arrays are dynamic, so the length of an array can increase or decrease as necessary. An array is appropriate when the number of data elements to be represented in the data structure is unpredictable. 19. Queue nodes are removed only from the front (head) of a queue and are inserted only at the back (tail) of the queue. 20. A node with no children is called a leaf node. SFCS Page 8 of 11

SECTION C : SUBJECTIVE QUESTIONS (60 MARKS) INSTRUCTION : ANSWER ALL QUESTIONS. Question 1 a) What is an algorithm? List THREE (3) characteristics of an algorithm? b) Give TWO (2) techniques that can be used to write an algorithm. (8 Marks) (2 Marks) Question 2 Given the nodes in liked list containing the integer values 16, 27, 92. Draw a picture of each type of the following linked list using the integer values given. (Do not use any dummy nodes) a) singly linked list b) circular linked list c) doubly linked list (9 Marks) Question 3 a) Convert the expression (A + B) * C - (D - E) * (F + G) to equivalent Prefix and Postfix notations. (6 Marks) b) Show the sequence of stack configuration in the evaluation of the following postfix expression = 2 4 * 9 5 + (5 Marks) SFCS Page 9 of 11

Question 4 Based on the binary tree given below, answer the following questions: a) What is the root element? b) How many elements are in the tree? c) How many leaves (leaf) are in the tree? d) What is the depth of the tree? e) What is the height of the tree? f) What would the output be if the elements were written out during: i. Preorder Traversal ii. Inorder Traversal iii. Postorder Traversal (5 Marks) (5 Marks) (5 Marks) SFCS Page 10 of 11

Question 5 Based on the following declarations: class Books { private: char title[50]; long ISBN; char publisher[50]; int year; float cost; public: Books(); Books(char[],long,char[],int,float); void ReadBookRecord(); void DisplayBookRecord(); ~Books(); }; a) How many members does class Books have? b) How many private members does class Books have? c) How many constructors does class Books have? List type of constructor use in class Books. (3 Marks) d) Write the definition of the default constructor of the class Books so that the private member variables are initialized to 0. (5 Marks) End of Page. SFCS Page 11 of 11