CS-301 Data Structure. Tariq Hanif
|
|
- Bethany Cunningham
- 5 years ago
- Views:
Transcription
1 1. The tree data structure is a Linear data structure Non-linear data structure Graphical data structure Data structure like queue FINALTERM EXAMINATION Spring 2012 CS301- Data Structure In the linked list implementation of the queue class, where does the insert member function place the new entry on the linked list? At the head At the tail After all other entries that are greater than the new entry. After all other entries that are smaller than the new entry 3.The operation for removing an entry from a stack is traditionally called: delete peek pop remove 4.A binary tree with N internal nodes has links, links to internal nodes and links to external nodes 2N, N-1, N+1 Page 315 N-1, 2N, N+1 N+1, N-1, 2N N+1, N-1, 2N 5.If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is. N N 2 N 2 log 2 N 6.A binary tree with 45 internal nodes has links to external nodes
2 7.Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot Which one of the following algorithms is least efficient, Quick Sort Insertion Sort Merge Sort Bubble Sort 9.A binary tree with 33 internal nodes has links to internal nodes The maximum number of external nodes (leaves) for a binary tree of height H is 2 H 2 H +1 2 H -1 2 H A complete binary tree of height has nodes between 16 to The worst case of building a heap of N keys is N N 2 Nlog2N 363 NlogN 2 N 13. Suppose we had a hash table whose hash function is n % 12, if the number 35 is already in the hash table, which of the following numbers would cause a collision? A binary tree with 24 internal nodes has external nodes
3 15- is a c data structure that can grow easily dynamically at run time without having to copy existing elements. Array List Two dimensional array Linked list 16.Whenever we write a class it begins with, Class body Class declaration Class name Class constructor 17. Which one of the following is TRUE about recursion? Recursion extensively uses stack memory. 149 Threaded Binary Trees use the concept of recursion. Recursive function calls consume a lot of memory. Recursive function calls consume a lot of memory. 18. If we insert a new node in an AVL tree which is perfectly balanced tree, then we will need to keep it AVL. One rotation Two rotations Rotations equal to number of levels No rotation at all 19. The worst case of deletion in AVL tree requires. Only one rotation Rotation at each non-leaf node Rotation at each leaf node Rotations equal to log 2 N 20. In Threaded Binary Tree, every node that does not have a right-child has a thread to its In-order predecessor Pre-order successor In-order successor Pre-order predecessor 21-In the Disjoint sets, union is a time operation. Constant Variable Exponential Quadratic 22. Merge sort and quick sort both fall into the same category of sorting algorithms, which is known as: O (NlogN) sorts Interchange sorts Quadratic average time sorts Complex sorts
4 23-In an array list, the worst case of removing an element is : To remove an element from the end of the list 16 To remove an element from the start of the list We cannot remove element from an array list To remove an element from the middle of the list 24. Which one of the following is NOT true about transient object? The lifetime of a transient object can exceed that of the application which is accessing it. An instance of an object type. Its lifetime cannot exceed that of the application. Not sure Application can also delete a transient object at any time. 25.In case of deleting a node from AVL tree, rotation could prolong to the... node. Leaf Root Middle node Sibling 26- Left pointer of dummy node in a threaded binary tree points to Itself while the right pointer points to the root of tree. Root node of the tree while the right pointer points itself Root node of the tree while the right pointer is always NULL. NULL while the right pointer of dummy node points to the itself. 27. In threaded Binary tree, we convert pointers of the tree to threads. Left Right Null 323 all 28. Which one of the following is NOT true regarding the skip list? Each list S i contains the special keys + infinity and - infinity. List S 0 contains the keys of S in non-decreasing order. Each list is a subsequence of the previous one. List S h contains only the n special keys. 29.The definition of Transitivity property is For all element x member of S, x R x For all elements x and y, x R y if and only if y R x For all elements x, y and z, if x R y and y R z then x R z For all elements w, x, y and z, if x R y and w R z then x R z.30.which one of the following is NOT an example of equivalence relation: Electrical connectivity Set of people <= relation Set of pixels 31.A find(x) on element x is performed by : returning exactly the same node that is found. returning the root of the tree containing x. returning the whole tree itself containing x. returning "true".
5 32.A simple sorting algorithm like selection sort or bubble sort has a worst-case of O(1) time because all lists take the same amount of time to sort O(n) time because it has to perform n swaps to order the list. O(n 2 ) time because sorting 1 element takes O(n) time O(n 3 ) time, because the worst case has really random input which takes longer to sort 33.Suppose A is an array containing numbers in increasing order, but some numbers occur more than once. When using a binary search for a value, the binary search always finds the first occurrence of value. the second occurrence of value. may find first or second occurrence of value. It will give an error. 34.When unions are done by weight (size) and N=1000,000 where N is the number of nodes then what will be the maximum levels of tree? 1000, What is the best definition of collision in a hash table? Two entries are identical except for their keys Two entries with different data have different keys. Two entries with different keys have the same hash value. Two entries with the same key have different hash values. 36. Which of the following is NOT true regarding the maze generation? Randomly remove walls until the entrance and exit cells are in the same set. Removing a wall is the same as doing a union operation. Remove a randomly chosen wall if the cells it separates are already in the same set. Do not remove a randomly chosen wall if the cells it separates are already in the same set. 37. Which of the given option is NOT a factor in Union by Size: Maintain sizes (number of nodes) of all trees Make smaller tree, the subtree of the larger one. Make the larger tree, the subtree of the smaller one Maintain sizes (number of nodes) while performing union operation 38. While deleting a node from Binary Search Tree (BST), which of the following number of cases we have to take care of? Function Calls are made with the help of which of the following data structures? Hash Table Stack Binary Tree Queue
6 40.A binary relation R over S is called an equivalence relation if it has which of the following property/properties? Reflexivity Symmetry Transitivity Reflexivity, Symmetry and Transitivity 394 FINALTERM EXAMINATION Spring 2012 CS301- Data Structure Numbers 5, 222, 4, 48 are inserted in a queue, which one will be removed first? The tree data structure is a Linear data structure Non-linear data structure 112 Graphical data structure Data structure like queue 3. Suppose that the class declaration of SomeClass includes the following function prototype. bool LessThan( SomeClass anotherobject ); Which of the following tests in the client code correctly compares two class objects alpha and beta? if (alpha < beta) if (alpha.lessthan(beta)) if (LessThan(alpha, beta)) if (LessThan(alpha).beta)
7 4.If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have? A binary tree of N nodes has. Log 10 N levels Log 2 N levels 227 N / 2 levels N x 2 levels 6. Binary Search is an algorithm of searching, used with the data. Sorted 439 Unsorted Heterogeneous Random 7. If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is. N N 2 Nlog 2 N log 2 N
8 8. Consider to following array After the first pass of a particular algorithm, the array looks like Name the algorithm used Heap sort Selection sort Insertion sort Bubble sort according to rule 9. Which of the following statement is true about dummy node of threaded binary tree? This dummy node never has a value. This dummy node has always some dummy value. This dummy node has either no value or some dummy value. 231 This dummy node has always some integer value. 10. Which of the following statement is NOT true about threaded binary tree? Right thread of the right-most node points to the dummy node. Left thread of the left-most node points to the dummy node. The left pointer of dummy node points to the root node of the tree. Left thread of the right-most node points to the dummy node A complete binary tree is a tree that is filled, with the possible exception of the bottom level. Partially Completely 323 Incompletely Partly
9 12. Consider a min heap, represented by the following array: 10,30,20,70,40,50,80,60 After inserting a node with value 31.Which of the following is the updated min heap? 10,30,20,31,40,50,80,60, ,30,20,70,40,50,80,60,31 10, 31,20,30,40,50,80,60,31 31,10,30,20,70,40,50,80, Consider a min heap, represented by the following array: 11,22,33,44,55 After inserting a node with value 66.Which of the following is the updated min heap? 11,22,33,44,55, ,22,33,44,66,55 11,22,33,66,44,55 11,22,66,33,44, What requirement is placed on an array, so that binary search may be used to locate an entry? The array elements must form a heap. The array must have at least 2 entries. Array must be sorted The array s size must be a power of two. 15. We can not remove items randomly from Stack 431 Two dimensional arrays Array Linked list
10 16. + is a operator. Unary Binary 61 Ternary Unary and Binary 17. Huffman encoding uses to develop codes of varying lengths for the letters used in the original message. Linked list Stack Queue Binary tree Merge sort and quick sort both falls into the same category of sorting algorithms, which is known as: O (NlogN) sorts Interchange sorts Quadratic average time sorts Complex sorts 19. Suppose h is height of Binary Search Tree, then maximum steps required for a search operation are h H+1 2 h 2 h 1
11 20. Suppose currentnode refers to a node in a linked list (using the Node class with member variables called data and nextnode). Which statement changes currentnode so that it refers to the next node? currentnode ++ currentnode = nextnode; currentnode += nextnode; currentnode = currentnode->nextnode; 21. During insertion, there are cases for rotation in an AVL tree Which of the following can NOT be a max-heap? In min-heap, the node with minimum value is. Root 519 Left most child Right most child It can be anywhere in the heap. 24. While building Huffman encoding tree, the new node that is the result of joining two nodes has the frequency. Equal to the small frequency Equal to the greater frequency Equal to sum of the two frequencies 293
12 Equal to difference of the two frequencies 25. If there are 23 external nodes in a Binary tree, then number of internal nodes will be : If there are N internal nodes in a binary tree, then number of external nodes will be: N -1 N N N Which of the following is a property of Binary tree? A binary tree of N external nodes has N internal nodes. A binary tree of N internal nodes has N+1 external nodes. 303 A binary tree of N external nodes has N+1 internal nodes. A binary tree of N internal nodes has N-1 external nodes. 28. Which one of the following is NOT true regarding the skip list? Each list S i contains the special keys + infinity and - infinity. List S 0 contains the keys of S in non-decreasing order. Each list is a subsequence of the previous one. List S h contains only the n special keys. 446
13 29. Which one of the following is NOT the property of equivalence relation: Reflexive Symmetric Transitive Associative The definition of Transitivity property is For all element x member of S, x R x For all elements x and y, x R y if and only if y R x For all elements x, y and z, if x R y and y R z then x R z 385 For all elements w, x, y and z, if x R y and w R z then x R z 31. A find(x) on element x is performed by : returning exactly the same node that is found returning the root of the tree containing x. returning the whole tree itself containing x. returning "true". 32. A simple sorting algorithm like selection sort or bubble sort has a worst-case of O(1) time because all lists take the same amount of time to sort O(n) time because it has to perform n swaps to order the list. 2 O(n ) time because sorting 1 element takes O(n) time O(n 3 ) time, because the worst case has really random input which takes longer to sort. 33. Here is an array of ten integers: Array after the FIRST iteration of the main loop in selection sort algorithm will be (sorting from smallest to largest):
14 Suppose A is an array containing numbers in increasing order, but some numbers occur more than once. When using a binary search for a value, the binary search always finds the first occurrence of value. the second occurrence of value. may find first or second occurrence of value It will give an error. 35. When unions are done by weight (size), the depth of any element is never greater than log2n 420 nlog2n nlog2n+1 log2n When unions are done by weight (size) and N=1000,000 where N is the number of nodes then what will be the maximum levels of tree? 1000, What is the best definition of collision in a hash table? Two entries are identical except for their keys. Two entries with different data have different keys. Two entries with different keys have the same hash value. 471 Two entries with the same key have different hash values.
15 38. Suppose currentnode refers to a node in a linked list (using the Node class with member variables called data and nextnode). Which boolean expression will be true when CurrentNode refers to the tail node of the list? (currentnode == null) (currentnode->nextnode == null) (nextnode.data == null) (currentnode.data == 0.0) 39. Consider the following infix expression: x y * a + b / c Which of the following is a correct equivalent expression for the above? x y -a * b +c / x *y a - b c / + x y a * - b c / + x y a * - b/ + c 40. If we have 1,000 sets each containing a unique person, then which of the following relations would be true on each set? Reflexive Symmetric Transitive Associative
Solved by: Syed Zain Ali Bukhari (BSCS)
Solved by: Syed Zain Ali Bukhari (BSCS) 1. If there are N internal nodes in a binary tree then what will be the no. of external nodes in this binary tree? N -1 N N +1 (Page 303) N +2 2.If there are N elements
More informationFINALTERM 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
FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should Use better data structures
More informationMID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.
MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct. In linked list the elements are necessarily to be contiguous In linked list the elements may locate at far positions
More informationMIDTERM EXAMINATION Spring 2010 CS301- Data Structures
MIDTERM EXAMINATION Spring 2010 CS301- Data Structures Question No: 1 Which one of the following statement is NOT correct. In linked list the elements are necessarily to be contiguous In linked list the
More informationCS301 - Data Structures Glossary By
CS301 - Data Structures Glossary By Abstract Data Type : A set of data values and associated operations that are precisely specified independent of any particular implementation. Also known as ADT Algorithm
More informationCS301- Data Structures LATEST SOLVED MCQS & SUBJECTIVE FROM MIDTERM PAPERS. 18 December 2014
س ت ع ين و ا ك ن ع ب د ا ك اے الله!) ی دت اور د CS301- Data Structures LATEST SOLVED MCQS & SUBJECTIVE FROM MIDTERM PAPERS With Reference Mega File 18 December 2014 Ijaz Ahmad BS Computer Science Virtual
More informationCS301 All Current Final Term Paper Subjective 2013 Solved with refernces
CS301 All Current Final Term Paper Subjective 2013 Solved with refernces Pattren: Total Questions: 52 Total Marks: 80 Total MCQs: 40 (Each of 1 Mark) Total Short Questions: 4 (Each of 2 Mark) Total Short
More informationEE 368. Weeks 5 (Notes)
EE 368 Weeks 5 (Notes) 1 Chapter 5: Trees Skip pages 273-281, Section 5.6 - If A is the root of a tree and B is the root of a subtree of that tree, then A is B s parent (or father or mother) and B is A
More informationBalanced Binary Search Trees. Victor Gao
Balanced Binary Search Trees Victor Gao OUTLINE Binary Heap Revisited BST Revisited Balanced Binary Search Trees Rotation Treap Splay Tree BINARY HEAP: REVIEW A binary heap is a complete binary tree such
More informationInstructions. Definitions. Name: CMSC 341 Fall Question Points I. /12 II. /30 III. /10 IV. /12 V. /12 VI. /12 VII.
CMSC 341 Fall 2013 Data Structures Final Exam B Name: Question Points I. /12 II. /30 III. /10 IV. /12 V. /12 VI. /12 VII. /12 TOTAL: /100 Instructions 1. This is a closed-book, closed-notes exam. 2. You
More informationCOSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)
COSC 2007 Data Structures II Final Exam Thursday, April 13 th, 2006 This is a closed book and closed notes exam. There are total 3 parts. Please answer the questions in the provided space and use back
More informationTrees. (Trees) Data Structures and Programming Spring / 28
Trees (Trees) Data Structures and Programming Spring 2018 1 / 28 Trees A tree is a collection of nodes, which can be empty (recursive definition) If not empty, a tree consists of a distinguished node r
More informationD. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.
CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to convert an array, with priorities stored at subscripts through n,
More informationCS102 Binary Search Trees
CS102 Binary Search Trees Prof Tejada 1 To speed up insertion, removal and search, modify the idea of a Binary Tree to create a Binary Search Tree (BST) Binary Search Trees Binary Search Trees have one
More information2-3 Tree. Outline B-TREE. catch(...){ printf( "Assignment::SolveProblem() AAAA!"); } ADD SLIDES ON DISJOINT SETS
Outline catch(...){ printf( "Assignment::SolveProblem() AAAA!"); } Balanced Search Trees 2-3 Trees 2-3-4 Trees Slide 4 Why care about advanced implementations? Same entries, different insertion sequence:
More informationComputational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs
Computational Optimization ISE 407 Lecture 16 Dr. Ted Ralphs ISE 407 Lecture 16 1 References for Today s Lecture Required reading Sections 6.5-6.7 References CLRS Chapter 22 R. Sedgewick, Algorithms in
More informationCSCE 2014 Final Exam Spring Version A
CSCE 2014 Final Exam Spring 2017 Version A Student Name: Student UAID: Instructions: This is a two-hour exam. Students are allowed one 8.5 by 11 page of study notes. Calculators, cell phones and computers
More informationB-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree
B-Trees Disk Storage What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree Deletion in a B-tree Disk Storage Data is stored on disk (i.e., secondary memory) in blocks. A block is
More informationData Structures and Algorithms
Data Structures and Algorithms CS245-2008S-19 B-Trees David Galles Department of Computer Science University of San Francisco 19-0: Indexing Operations: Add an element Remove an element Find an element,
More information1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1
Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 2. O(n) 2. [1 pt] What is the solution to the recurrence T(n) = T(n/2) + n, T(1)
More informationBasic Data Structures (Version 7) Name:
Prerequisite Concepts for Analysis of Algorithms Basic Data Structures (Version 7) Name: Email: Concept: mathematics notation 1. log 2 n is: Code: 21481 (A) o(log 10 n) (B) ω(log 10 n) (C) Θ(log 10 n)
More informationCS 2150 Final Exam, Spring 2018 Page 1 of 10 UVa userid:
CS 2150 Final Exam, Spring 2018 Page 1 of 10 UVa userid: CS 2150 Final Exam Name You MUST write your e-mail ID on EACH page and put your name on the top of this page, too. If you are still writing when
More informationCourse Review for Finals. Cpt S 223 Fall 2008
Course Review for Finals Cpt S 223 Fall 2008 1 Course Overview Introduction to advanced data structures Algorithmic asymptotic analysis Programming data structures Program design based on performance i.e.,
More informationData Structures Question Bank Multiple Choice
Section 1. Fundamentals: Complexity, Algorthm Analysis 1. An algorithm solves A single problem or function Multiple problems or functions Has a single programming language implementation 2. A solution
More informationBinary Trees. BSTs. For example: Jargon: Data Structures & Algorithms. root node. level: internal node. edge.
Binary Trees 1 A binary tree is either empty, or it consists of a node called the root together with two binary trees called the left subtree and the right subtree of the root, which are disjoint from
More informationAdvanced Set Representation Methods
Advanced Set Representation Methods AVL trees. 2-3(-4) Trees. Union-Find Set ADT DSA - lecture 4 - T.U.Cluj-Napoca - M. Joldos 1 Advanced Set Representation. AVL Trees Problem with BSTs: worst case operation
More informationSorted Arrays. Operation Access Search Selection Predecessor Successor Output (print) Insert Delete Extract-Min
Binary Search Trees FRIDAY ALGORITHMS Sorted Arrays Operation Access Search Selection Predecessor Successor Output (print) Insert Delete Extract-Min 6 10 11 17 2 0 6 Running Time O(1) O(lg n) O(1) O(1)
More information9/29/2016. Chapter 4 Trees. Introduction. Terminology. Terminology. Terminology. Terminology
Introduction Chapter 4 Trees for large input, even linear access time may be prohibitive we need data structures that exhibit average running times closer to O(log N) binary search tree 2 Terminology recursive
More informationA6-R3: DATA STRUCTURE THROUGH C LANGUAGE
A6-R3: DATA STRUCTURE THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF
More informationCourse Review. Cpt S 223 Fall 2009
Course Review Cpt S 223 Fall 2009 1 Final Exam When: Tuesday (12/15) 8-10am Where: in class Closed book, closed notes Comprehensive Material for preparation: Lecture slides & class notes Homeworks & program
More informationOperations on Heap Tree The major operations required to be performed on a heap tree are Insertion, Deletion, and Merging.
Priority Queue, Heap and Heap Sort In this time, we will study Priority queue, heap and heap sort. Heap is a data structure, which permits one to insert elements into a set and also to find the largest
More informationPriority Queues. 04/10/03 Lecture 22 1
Priority Queues It is a variant of queues Each item has an associated priority value. When inserting an item in the queue, the priority value is also provided for it. The data structure provides a method
More informationMLR Institute of Technology
MLR Institute of Technology Laxma Reddy Avenue, Dundigal, Quthbullapur (M), Hyderabad 500 043 Phone Nos: 08418 204066 / 204088, Fax : 08418 204088 TUTORIAL QUESTION BANK Course Name : DATA STRUCTURES Course
More informationCS 206 Introduction to Computer Science II
CS 206 Introduction to Computer Science II 04 / 25 / 2018 Instructor: Michael Eckmann Today s Topics Questions? Comments? Balanced Binary Search trees AVL trees / Compression Uses binary trees Balanced
More informationProgramming II (CS300)
1 Programming II (CS300) Chapter 10: Search and Heaps MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Search and Heaps 2 Linear Search Binary Search Introduction to trees Priority Queues Heaps Linear Search
More informationDirect Addressing Hash table: Collision resolution how handle collisions Hash Functions:
Direct Addressing - key is index into array => O(1) lookup Hash table: -hash function maps key to index in table -if universe of keys > # table entries then hash functions collision are guaranteed => need
More informationUNIT III BALANCED SEARCH TREES AND INDEXING
UNIT III BALANCED SEARCH TREES AND INDEXING OBJECTIVE The implementation of hash tables is frequently called hashing. Hashing is a technique used for performing insertions, deletions and finds in constant
More informationAlgorithms in Systems Engineering ISE 172. Lecture 16. Dr. Ted Ralphs
Algorithms in Systems Engineering ISE 172 Lecture 16 Dr. Ted Ralphs ISE 172 Lecture 16 1 References for Today s Lecture Required reading Sections 6.5-6.7 References CLRS Chapter 22 R. Sedgewick, Algorithms
More informationINSTITUTE OF AERONAUTICAL ENGINEERING
INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad - 500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name Course Code Class Branch DATA STRUCTURES ACS002 B. Tech
More information( D. Θ n. ( ) f n ( ) D. Ο%
CSE 0 Name Test Spring 0 Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to run the code below is in: for i=n; i>=; i--) for j=; j
More information) $ f ( n) " %( g( n)
CSE 0 Name Test Spring 008 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to compute the sum of the n elements of an integer array is: # A.
More informationPseudo code of algorithms are to be read by.
Cs502 Quiz No1 Complete Solved File Pseudo code of algorithms are to be read by. People RAM Computer Compiler Approach of solving geometric problems by sweeping a line across the plane is called sweep.
More informationR10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May
www.jwjobs.net R10 SET - 1 II B. Tech I Semester, Supplementary Examinations, May - 2012 (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 *******-****** 1. a) Which of the given options provides the
More informationFinal Examination CSE 100 UCSD (Practice)
Final Examination UCSD (Practice) RULES: 1. Don t start the exam until the instructor says to. 2. This is a closed-book, closed-notes, no-calculator exam. Don t refer to any materials other than the exam
More informationRecitation 9. Prelim Review
Recitation 9 Prelim Review 1 Heaps 2 Review: Binary heap min heap 1 2 99 4 3 PriorityQueue Maintains max or min of collection (no duplicates) Follows heap order invariant at every level Always balanced!
More information( ) n 3. n 2 ( ) D. Ο
CSE 0 Name Test Summer 0 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n n matrices is: A. Θ( n) B. Θ( max( m,n, p) ) C.
More informationModule 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree.
The Lecture Contains: Index structure Binary search tree (BST) B-tree B+-tree Order file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture13/13_1.htm[6/14/2012
More informationTable of Contents. Chapter 1: Introduction to Data Structures... 1
Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction
More informationData Structure. A way to store and organize data in order to support efficient insertions, queries, searches, updates, and deletions.
DATA STRUCTURES COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges book. Data
More informationCSCI-1200 Data Structures Fall 2018 Lecture 23 Priority Queues II
Review from Lecture 22 CSCI-1200 Data Structures Fall 2018 Lecture 23 Priority Queues II Using STL s for_each, Function Objects, a.k.a., Functors STL s unordered_set (and unordered_map) Hash functions
More informationR10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May
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
More informationCS 251, LE 2 Fall MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY
CS 251, LE 2 Fall 2016 MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY W1.) (i) Show one possible valid 2-3 tree containing the nine elements: 1 3 4 5 6 8 9 10 12. (ii) Draw the final binary search
More informationlogn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)
CSE 0 Test Your name as it appears on your UTA ID Card Fall 0 Multiple Choice:. Write the letter of your answer on the line ) to the LEFT of each problem.. CIRCLED ANSWERS DO NOT COUNT.. points each. The
More informationA6-R3: DATA STRUCTURE THROUGH C LANGUAGE
A6-R3: DATA STRUCTURE THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF
More informationCS 310 B-trees, Page 1. Motives. Large-scale databases are stored in disks/hard drives.
CS 310 B-trees, Page 1 Motives Large-scale databases are stored in disks/hard drives. Disks are quite different from main memory. Data in a disk are accessed through a read-write head. To read a piece
More informationSecond Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...
Second Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms.... Q1) Let the keys are 28, 47, 20, 36, 43, 23, 25, 54 and table size is 11 then H(28)=28%11=6; H(47)=47%11=3;
More informationSummer Final Exam Review Session August 5, 2009
15-111 Summer 2 2009 Final Exam Review Session August 5, 2009 Exam Notes The exam is from 10:30 to 1:30 PM in Wean Hall 5419A. The exam will be primarily conceptual. The major emphasis is on understanding
More informationIntroduction. for large input, even access time may be prohibitive we need data structures that exhibit times closer to O(log N) binary search tree
Chapter 4 Trees 2 Introduction for large input, even access time may be prohibitive we need data structures that exhibit running times closer to O(log N) binary search tree 3 Terminology recursive definition
More informationCOMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 9 - Jan. 22, 2018 CLRS 12.2, 12.3, 13.2, read problem 13-3 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures
More informationUniversity of Illinois at Urbana-Champaign Department of Computer Science. Second Examination
University of Illinois at Urbana-Champaign Department of Computer Science Second Examination CS 225 Data Structures and Software Principles Spring 2014 7-10p, Tuesday, April 8 Name: NetID: Lab Section
More informationDelhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:
Serial : 1PT_CS_A+C_Programming & Data Structure_230918 Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: E-mail: info@madeeasy.in Ph: 011-45124612 CLASS TEST 2018-19
More information( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1
CSE 0 Name Test Summer 00 Last Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose you are sorting millions of keys that consist of three decimal
More informationQuiz 1 Solutions. (a) f(n) = n g(n) = log n Circle all that apply: f = O(g) f = Θ(g) f = Ω(g)
Introduction to Algorithms March 11, 2009 Massachusetts Institute of Technology 6.006 Spring 2009 Professors Sivan Toledo and Alan Edelman Quiz 1 Solutions Problem 1. Quiz 1 Solutions Asymptotic orders
More informationCourse Review. Cpt S 223 Fall 2010
Course Review Cpt S 223 Fall 2010 1 Final Exam When: Thursday (12/16) 8-10am Where: in class Closed book, closed notes Comprehensive Material for preparation: Lecture slides & class notes Homeworks & program
More informationMULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR
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
More informationCOMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 9 - Jan. 22, 2018 CLRS 12.2, 12.3, 13.2, read problem 13-3 University of Manitoba 1 / 12 Binary Search Trees (review) Structure
More informationTest 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1
CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each t. What is the value of k? k=0 A. k B. t C. t+ D. t+ +. Suppose that you have
More informationProgramming II (CS300)
1 Programming II (CS300) Chapter 12: Heaps and Priority Queues MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Heaps and Priority Queues 2 Priority Queues Heaps Priority Queue 3 QueueADT Objects are added and
More informationCSE100. Advanced Data Structures. Lecture 8. (Based on Paul Kube course materials)
CSE100 Advanced Data Structures Lecture 8 (Based on Paul Kube course materials) CSE 100 Treaps Find, insert, delete, split, and join in treaps Randomized search trees Randomized search tree time costs
More informationTree: non-recursive definition. Trees, Binary Search Trees, and Heaps. Tree: recursive definition. Tree: example.
Trees, Binary Search Trees, and Heaps CS 5301 Fall 2013 Jill Seaman Tree: non-recursive definition Tree: set of nodes and directed edges - root: one node is distinguished as the root - Every node (except
More informationAnalysis of Algorithms
Analysis of Algorithms Trees-I Prof. Muhammad Saeed Tree Representation.. Analysis Of Algorithms 2 .. Tree Representation Analysis Of Algorithms 3 Nomenclature Nodes (13) Size (13) Degree of a node Depth
More informationLec 17 April 8. Topics: binary Trees expression trees. (Chapter 5 of text)
Lec 17 April 8 Topics: binary Trees expression trees Binary Search Trees (Chapter 5 of text) Trees Linear access time of linked lists is prohibitive Heap can t support search in O(log N) time. (takes O(N)
More informationFundamentals of Data Structure
Fundamentals of Data Structure Set-1 1. Which if the following is/are the levels of implementation of data structure A) Abstract level B) Application level C) Implementation level D) All of the above 2.
More informationExercise 1 : B-Trees [ =17pts]
CS - Fall 003 Assignment Due : Thu November 7 (written part), Tue Dec 0 (programming part) Exercise : B-Trees [+++3+=7pts] 3 0 3 3 3 0 Figure : B-Tree. Consider the B-Tree of figure.. What are the values
More informationDATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305
Q.1 If h is any hashing function and is used to hash n keys in to a table of size m, where n
More informationLecture 5. Treaps Find, insert, delete, split, and join in treaps Randomized search trees Randomized search tree time costs
Lecture 5 Treaps Find, insert, delete, split, and join in treaps Randomized search trees Randomized search tree time costs Reading: Randomized Search Trees by Aragon & Seidel, Algorithmica 1996, http://sims.berkeley.edu/~aragon/pubs/rst96.pdf;
More informationEnd-Term Examination Second Semester [MCA] MAY-JUNE 2006
(Please write your Roll No. immediately) Roll No. Paper Code: MCA-102 End-Term Examination Second Semester [MCA] MAY-JUNE 2006 Subject: Data Structure Time: 3 Hours Maximum Marks: 60 Note: Question 1.
More informationAlgorithms. AVL Tree
Algorithms AVL Tree Balanced binary tree The disadvantage of a binary search tree is that its height can be as large as N-1 This means that the time needed to perform insertion and deletion and many other
More informationB-Trees. Version of October 2, B-Trees Version of October 2, / 22
B-Trees Version of October 2, 2014 B-Trees Version of October 2, 2014 1 / 22 Motivation An AVL tree can be an excellent data structure for implementing dictionary search, insertion and deletion Each operation
More informationDepartment of Computer Science and Technology
UNIT : Stack & Queue Short Questions 1 1 1 1 1 1 1 1 20) 2 What is the difference between Data and Information? Define Data, Information, and Data Structure. List the primitive data structure. List the
More informationSection 1: True / False (1 point each, 15 pts total)
Section : True / False ( point each, pts total) Circle the word TRUE or the word FALSE. If neither is circled, both are circled, or it impossible to tell which is circled, your answer will be considered
More informationNET/JRF-COMPUTER SCIENCE & APPLICATIONS. Time: 01 : 00 Hour Date : M.M. : 50
1 NET/JRF-COMPUTER SCIENCE & APPLICATIONS UNIT TEST : DATA STRUCTURE Time: 01 : 00 Hour Date : 02-06-2017 M.M. : 50 INSTRUCTION: Attempt all the 25 questions. Each question carry TWO marks. 1. Consider
More informationData Structure and Algorithm Midterm Reference Solution TA
Data Structure and Algorithm Midterm Reference Solution TA email: dsa1@csie.ntu.edu.tw Problem 1. To prove log 2 n! = Θ(n log n), it suffices to show N N, c 1, c 2 > 0 such that c 1 n ln n ln n! c 2 n
More informationTREES. Trees - Introduction
TREES Chapter 6 Trees - Introduction All previous data organizations we've studied are linear each element can have only one predecessor and successor Accessing all elements in a linear sequence is O(n)
More informationCOMP 103 Introduction to Data Structures and Algorithms
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Student ID:..................... EXAMINATIONS 2005 END-YEAR COMP 103 Introduction to Data
More informationI2206 Data Structures TS 6: Binary Trees - Binary Search Trees
Lebanese University BS - Computer Science Faculty of Science 2018-2019 Section I I2206 Data Structures TS 6: Binary Trees - Binary Search Trees Exercise 1 What value does the following C function return?
More informationBINARY HEAP cs2420 Introduction to Algorithms and Data Structures Spring 2015
BINARY HEAP cs2420 Introduction to Algorithms and Data Structures Spring 2015 1 administrivia 2 -assignment 10 is due on Thursday -midterm grades out tomorrow 3 last time 4 -a hash table is a general storage
More informationCSE 326: Data Structures Lecture #8 Binary Search Trees
CSE 6: Data Structures Lecture #8 Binary Search Trees Alon Halevy Spring Quarter Binary Trees Many algorithms are efficient and easy to program for the special case of binary trees B A C Binary tree is
More informationUniversity of Waterloo Department of Electrical and Computer Engineering ECE 250 Data Structures and Algorithms. Final Examination
University of Waterloo Department of Electrical and Computer Engineering ECE 250 Data Structures and Algorithms Instructor: Douglas Wilhelm Harder Time: 2.5 hours Aides: none 14 pages Final Examination
More informationAnalysis of Algorithms
Analysis of Algorithms Concept Exam Code: 16 All questions are weighted equally. Assume worst case behavior and sufficiently large input sizes unless otherwise specified. Strong induction Consider this
More informationR16 SET - 1 '' ''' '' ''' Code No: R
1. a) Define Latency time and Transmission time? (2M) b) Define Hash table and Hash function? (2M) c) Explain the Binary Heap Structure Property? (3M) d) List the properties of Red-Black trees? (3M) e)
More information! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge
Trees & Heaps Week 12 Gaddis: 20 Weiss: 21.1-3 CS 5301 Fall 2018 Jill Seaman!1 Tree: non-recursive definition! Tree: set of nodes and directed edges - root: one node is distinguished as the root - Every
More informationCS 315 Data Structures mid-term 2
CS 315 Data Structures mid-term 2 1) Shown below is an AVL tree T. Nov 14, 2012 Solutions to OPEN BOOK section. (a) Suggest a key whose insertion does not require any rotation. 18 (b) Suggest a key, if
More information(2,4) Trees Goodrich, Tamassia (2,4) Trees 1
(2,4) Trees 9 2 5 7 10 14 2004 Goodrich, Tamassia (2,4) Trees 1 Multi-Way Search Tree A multi-way search tree is an ordered tree such that Each internal node has at least two children and stores d -1 key-element
More informationCpt S 223 Fall Cpt S 223. School of EECS, WSU
Course Review Cpt S 223 Fall 2012 1 Final Exam When: Monday (December 10) 8 10 AM Where: in class (Sloan 150) Closed book, closed notes Comprehensive Material for preparation: Lecture slides & class notes
More information8. Write an example for expression tree. [A/M 10] (A+B)*((C-D)/(E^F))
DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING EC6301 OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES UNIT IV NONLINEAR DATA STRUCTURES Part A 1. Define Tree [N/D 08]
More information9. Heap : Priority Queue
9. Heap : Priority Queue Where We Are? Array Linked list Stack Queue Tree Binary Tree Heap Binary Search Tree Priority Queue Queue Queue operation is based on the order of arrivals of elements FIFO(First-In
More informationSOLUTIONS. COMP103 Introduction to Data Structures and Algorithms
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Student ID:....................... EXAMINATIONS 2011 MID YEAR COMP103 Introduction to Data
More informationBalanced Search Trees. CS 3110 Fall 2010
Balanced Search Trees CS 3110 Fall 2010 Some Search Structures Sorted Arrays Advantages Search in O(log n) time (binary search) Disadvantages Need to know size in advance Insertion, deletion O(n) need
More informationCourse Review for. Cpt S 223 Fall Cpt S 223. School of EECS, WSU
Course Review for Midterm Exam 1 Cpt S 223 Fall 2011 1 Midterm Exam 1 When: Friday (10/14) 1:10-2pm Where: in class Closed book, closed notes Comprehensive Material for preparation: Lecture slides & in-class
More information