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


 Brenda Anthony
 2 years ago
 Views:
Transcription
1 Questions 1 through 25 are worth 2 points each. Choose one best answer for each. 1. For the singly linked list implementation of the queue, where are the enqueues and dequeues performed? c a. Enqueue in front of the first element, dequeue the first element b. Enqueue after the last element, dequeue the last element c. Enqueue after the last element, dequeue the first element d. Enqueue in front of the first element, dequeue the last element e. Enqueue after the first element, dequeue the first element 2. Which operation is not supported in constant time by a doubleended queue (deque)? d a. Insertion at the front or rear item b. Access to the front or rear item c. Deletion of the front or rear item d. Access and deletion of the minimum item e. All of the above are supported 3. Which of the following operations is not efficiently supported by a singly linked list? c a. accessing the element in the current position b. insertion after the current position c. moving to the position immediately prior to the current position d. moving to the position immediately following the current position e. all of the above are efficiently supported 4. What operation is supported in constant time by the doubly linked list, but not supported in constant time by the singly linked list? b a. first c. advance b. retreat d. all are constant time on singly linked list 5. Insertion of a node into a doubly linked list requires how many changes to next and prev references? c a. no changes d. 3 next, 3 prev b. 1 next, 1 prev e. none of the above c. 2 next, 2 prev 6. What is the running time for merging two singly linked lists into a single singly linked list? a (d only if there was a tail pointer on one of the lists) a. O(N) d. O(1) b. O(N 2 ) e. None of the above. c. O(N log N) 7. Consider an operation in which you need to return the elements immediately preceding and following a given item x. Which variation of lists would be most efficient? d a. singly linked list d. doubly linked list b. singly linked list with header and trailer nodes e. none of the above c. circular list 1
2 8. Which of the following algorithms requires the most extra space when implemented as in the text? b a. insertion sort d. shellsort b. mergesort e. all use only constant extra space c. quicksort 9. Which of the following algorithms runs in N log N average time but quadratic worstcase time? c a. insertion sort d. shellsort b. mergesort e. none of the above c. quicksort 10. If the array is already sorted, which algorithm will perform best? a a. insertion sort d. quicksort b. selection sort e. All will take same amount of time c. merge sort 11. Which data structure is used by the compiler to implement recursion? e a. hash table d. search tree b. priority queue e. stack c. queue 12. The following method violates which rule(s) of recursion? d static int recurse( int n ) if( n == 0 ) else return n + recurse( n/2 )+ recurse( n/2+1 ); a. No base case c. Performs redundant work b. Fails to make progress toward base case d. (b) and (c) 13. A recursive algorithm works by solving two halfsized problems recursively, with an additional lineartime overhead. The total running time is most accurately given by c a. O( log N ) d. O( N 2 ) b. O( N ) e. none of the above c. O( N log N ) 14. Which of the following, as discussed in lecture, is a binary tree? d a. Expression tree d. (a) and (b) b. Huffman coding tree e. none of (a), (b), and (c) c. Unix file system 15. Which of the following traversals requires more than linear time in the worst case? e b. level order e. all of these traversals are linear time 2
3 16. A node with key 8 has a left child with key 10. Which of the following objects could this node be found in? c a. binary search tree d. (a) and (c) b. max heap e. none of (a), (b), and (c) c. min heap 17. Which iterator traversal does not use a stack? b b. level order e. all of these traversals use a stack 18. How many N node binary trees with items 1, 2,..., N have identical preorder and inorder traversals? b a. 0 d. N! b. 1 e. none of the above c. N 19. The following items are inserted into a binary search tree: 3, 6, 5, 2, 4, 7, 1. Which node is the deepest? c a. 1 d. 7 b. 3 e. none of the above c. 4 The next four questions (20 through 23) relate to the tree below: A B C D E 20. Which of the following traversals yields ABCDE? e b. level order e. (b) and (d) 21. Which output could be produced by an inorder traversal of the tree? e a. ABCDE d. EDCBA b. ABDCE e. none of the above c. BDECA 22. The height of the tree is c a. 0 d. 3 b. 1 e. none of the above c. 2 3
4 23. Suppose a postorder iteration is performed on the tree. At the time that D is output, what symbols are still on the stack? c a. A only d. A, B, and C b. A and B only e. none of the above c. A and C only 24. Which of the following is not a redblack tree property? b a. the root is black b. all leaves are black c. consecutive red nodes are disallowed d. every path from a node to an external node must contain the same number of black nodes e. all of the above are redblack tree properties 25. Every node in a binary min heap b a. has two children b. is no larger than its children c. is no smaller than its children d. has a smaller left child than right child e. two or more of the above 26. (10 pts) Show the result of inserting 3, 1, 4, 6, 9, 2, 5, and 7 in an initially empty binary search tree. Then show the result of deleting the root. You should draw 2 separate trees to answer this question. First tree Inorder listing: Preorder listing: Postorder lising: Second tree Inorder listing: Preorder listing: Postorder lising: (20 pts) Show the result of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, and 2, one at a time, into an initially empty binary min heap Either draw each intermediate heap or give a level order listing of the nodes in each intermediate heap for full credit (15 trees or 15 listings total). 2 points extra credit for both trees and level order listings!! The following are levelorder listings of the trees: Tree 1: 10 Tree 2: Tree 3: Tree 4: Tree 5: Tree 6: Tree 7: Tree 8: Tree 9: Tree 10: Tree 11: Tree 12: Tree 13: Tree 14: Tree 15:
5 28. (20 pts) Write methods that take a reference to a binary tree root T, compute, and return the quantities specified in parts (a) and (b) below. Assume T is a reference to a BinaryNode object and that each node in the linked tree contains a key and pointers to left and right BinaryNode children. Include the code for any helper methods you use. a) The number of leaves in T. Method in BinaryTree class: public int countleaves(binarynode T) if (T == null) if (T.getLeft() == null && T.getRight() == null) return 1; return countleaves(t.getleft())+countleaves(t.getright()); b) The number of nodes in T that have one nonnull child. Method in BinaryTree class: public int countsolos(binarynode T) if (T == null) if (T.getLeft()==null && T.getRight()==null) else if (T.getLeft()==null && T.getRight()!=null) return 1 + countsolos(getright()); if (T.getLeft()!=null && T.getRight()==null) return 1 + countsolos(getleft()) return countsolos(getleft())+countsolos(getright()); 5
DATA STRUCTURES USING C
DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give
More information1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++
Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The
More informationData Structure [Question Bank]
Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:
More informationCOURSE: B.TECHECE. IV Sem. Data structure Using C. b) Deletion of element in an array
COURSE: B.TECHECE. IV Sem Data structure Using C 1. Determine the formula to find the address location of an element in three dimensions array, suppose each element takes four bytes of space & elements
More informationKrishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA213 : DATA STRUCTURES USING C
Tutorial#1 Q 1: Explain the terms data, elementary item, entity, primary key, domain, attribute and information? Also give examples in support of your answer? Q 2: What is a Data Type? Differentiate
More informationBinary Search Trees CMPSC 122
Binary Search Trees CMPSC 122 Note: This notes packet has significant overlap with the first set of trees notes I do in CMPSC 360, but goes into much greater depth on turning BSTs into pseudocode than
More informationBinary Trees and Huffman Encoding Binary Search Trees
Binary Trees and Huffman Encoding Binary Search Trees Computer Science E119 Harvard Extension School Fall 2012 David G. Sullivan, Ph.D. Motivation: Maintaining a Sorted Collection of Data A data dictionary
More informationConverting a Number from Decimal to Binary
Converting a Number from Decimal to Binary Convert nonnegative integer in decimal format (base 10) into equivalent binary number (base 2) Rightmost bit of x Remainder of x after division by two Recursive
More informationChapter 14 The Binary Search Tree
Chapter 14 The Binary Search Tree In Chapter 5 we discussed the binary search algorithm, which depends on a sorted vector. Although the binary search, being in O(lg(n)), is very efficient, inserting a
More information10CS35: Data Structures Using C
CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions  a conventional tool for handling a
More informationData Structures, Practice Homework 3, with Solutions (not to be handed in)
Data Structures, Practice Homework 3, with Solutions (not to be handed in) 1. Carrano, 4th edition, Chapter 9, Exercise 1: What is the order of each of the following tasks in the worst case? (a) Computing
More informationPES Institute of TechnologyBSC QUESTION BANK
PES Institute of TechnologyBSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions
More information5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.
1. The advantage of.. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. [A] Lists [B] Linked Lists [A] Trees [A] Queues 2. The
More informationJava Software Structures
INTERNATIONAL EDITION Java Software Structures Designing and Using Data Structures FOURTH EDITION John Lewis Joseph Chase This page is intentionally left blank. Java Software Structures,International Edition
More informationSorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)
Sorting revisited How did we use a binary search tree to sort an array of elements? Tree Sort Algorithm Given: An array of elements to sort 1. Build a binary search tree out of the elements 2. Traverse
More informationData Structures. Level 6 C30151. www.fetac.ie. Module Descriptor
The Further Education and Training Awards Council (FETAC) was set up as a statutory body on 11 June 2001 by the Minister for Education and Science. Under the Qualifications (Education & Training) Act,
More informationCSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.
Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure
More informationINTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY A PATH FOR HORIZING YOUR INNOVATIVE WORK A REVIEW ON THE USAGE OF OLD AND NEW DATA STRUCTURE ARRAYS, LINKED LIST, STACK,
More information12 Abstract Data Types
12 Abstract Data Types 12.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT).
More informationData Structures 2014
Unit1 Introduction Short Questions:1. Define data structure. 2. Define algorithm. 3. List out areas in which data structures are applied. 4. List out structure of algorithm. 5. List out properties of
More information1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated
More informationMAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push) 
=============================================================================================================================== DATA STRUCTURE PSEUDOCODE EXAMPLES (c) Mubashir N. Mir  www.mubashirnabi.com
More informationBinary Heap Algorithms
CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks CHAPPELLG@member.ams.org 2005 2009 Glenn G. Chappell
More informationAS2261 M.Sc.(First Semester) Examination2013 Paper fourth SubjectData structure with algorithm
AS2261 M.Sc.(First Semester) Examination2013 Paper fourth SubjectData structure with algorithm Time: Three Hours] [Maximum Marks: 60 Note Attempts all the questions. All carry equal marks Section A
More informationComparison Sort.  In Merge Sort, the merge procedure chooses an item from one of two arrays after comparing the top items from both arrays.
Comparison Sort A Comparison Sort is a sorting algorithm where the final order is determined only by comparisons between the input elements.  In Insertion Sort, the proper position to insert the current
More informationAP Computer Science AB Syllabus 1
AP Computer Science AB Syllabus 1 Course Resources Java Software Solutions for AP Computer Science, J. Lewis, W. Loftus, and C. Cocking, First Edition, 2004, Prentice Hall. Video: Sorting Out Sorting,
More informationBinary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( BST) are of the form. P parent. Key. Satellite data L R
Binary Search Trees A Generic Tree Nodes in a binary search tree ( BST) are of the form P parent Key A Satellite data L R B C D E F G H I J The BST has a root node which is the only node whose parent
More informationOverview of Data Structures
UNIT 3 Concrete Data Types Classification of Data Structures Concrete vs. Abstract Data Structures Most Important Concrete Data Structures Arrays Records Linked Lists Binary Trees Overview of Data Structures
More informationECE 250 Data Structures and Algorithms MIDTERM EXAMINATION 20081023/5:156:45 REC200, EVI350, RCH106, HH139
ECE 250 Data Structures and Algorithms MIDTERM EXAMINATION 20081023/5:156:45 REC200, EVI350, RCH106, HH139 Instructions: No aides. Turn off all electronic media and store them under your desk. If
More informationroot node level: internal node edge leaf node CS@VT Data Structures & Algorithms 20002009 McQuain
inary 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 each
More informationUNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK PSD2023 ALGORITHM & DATA STRUCTURE
STUDENT IDENTIFICATION NO UNIVERSITI MALAYSIA SARAWAK 94300 KOTA SAMARAHAN SARAWAK FAKULTI SAINS KOMPUTER & TEKNOLOGI MAKLUMAT (Faculty of Computer Science & Information Technology) Diploma in Multimedia
More informationLinked Lists, Stacks, Queues, Deques. It s time for a chainge!
Linked Lists, Stacks, Queues, Deques It s time for a chainge! Learning Goals After this unit, you should be able to... Differentiate an abstraction from an implementation. Define and give examples of problems
More informationOrdered Lists and Binary Trees
Data Structures and Algorithms Ordered Lists and Binary Trees Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/62 60:
More informationWeek 8: Trees. Readings. Tree. Relationship. 9 October internal nodes. root. leaves
Week : Trees nus.soc.cs0b.week Readings Required [Weiss] ch.. [Weiss] ch.. [Weiss] ch.. Exercises [Weiss].,.,.,. [Weiss].,.. Fun http://www.seanet.com/users/arsen/avltree.html nus.soc.cs0b.week Tree root
More informationBinary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *
Binary Heaps A binary heap is another data structure. It implements a priority queue. Priority Queue has the following operations: isempty add (with priority) remove (highest priority) peek (at highest
More informationThe ADT Binary Search Tree. Recursive Tree Traversals. The ADT Binary Search Tree. The ADT Binary Search Tree. Inorder
Recursive Tree Traversals The ADT Binary Search Tree Inorder private void printinorder(treenode node) { if (node!= null) { printinorder(node.getleft()); System.out.print(node.getItem() + " "); printinorder(node.getright());
More informationA TOOL FOR DATA STRUCTURE VISUALIZATION AND USERDEFINED ALGORITHM ANIMATION
A TOOL FOR DATA STRUCTURE VISUALIZATION AND USERDEFINED ALGORITHM ANIMATION Tao Chen 1, Tarek Sobh 2 Abstract  In this paper, a software application that features the visualization of commonly used
More informationData Structures. Topic #4
Topic #4 Today s Agenda Stack and Queue ADTs What are they Like Ordered Lists, are position oriented Use of Data Structures for Stacks and Queues arrays (statically & dynamically allocated) linear linked
More informationA binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:
Binary Search Trees 1 The general binary tree shown in the previous chapter is not terribly useful in practice. The chief use of binary trees is for providing rapid access to data (indexing, if you will)
More informationDEPARTMENT OF SCIENCE AND HUMANITIES CS6202PROGRAMMING AND DATA STRUCTURES I QUESTION BANK
DEPARTMENT OF SCIENCE AND HUMANITIES Sem/Year/Branch: II/I/CSE CS6202PROGRAMMING AND DATA STRUCTURES I QUESTION BANK UNIT I 1. Give two examples of C preprocessors with syntax.(apr/may 2015) 2. What are
More informationData Structures Fibonacci Heaps, Amortized Analysis
Chapter 4 Data Structures Fibonacci Heaps, Amortized Analysis Algorithm Theory WS 2012/13 Fabian Kuhn Fibonacci Heaps Lacy merge variant of binomial heaps: Do not merge trees as long as possible Structure:
More informationPriority Queues. Client, Implementation, Interface. Priority Queues. Abstract Data Types
Client, Implementation, Interface Priority Queues Priority Queue ADT Binary heaps Heapsort Reference: Chapter 6, Algorithms in Java, 3 rd Edition, Robert Sedgewick. Separate interface and implementation
More informationAlgorithms and Data Structures Written Exam Proposed SOLUTION
Algorithms and Data Structures Written Exam Proposed SOLUTION 20050107 from 09:00 to 13:00 Allowed tools: A standard calculator. Grading criteria: You can get at most 30 points. For an E, 15 points are
More informationTrees. Tree Definitions: Let T = (V, E, r) be a tree. The size of a tree denotes the number of nodes of the tree.
Trees After lists (including stacks and queues) and hash tables, trees represent one of the most widely used data structures. On one hand trees can be used to represent objects that are recursive in nature
More informationTrees LOGO STYLE GUIDE Schools within the University 1 19
Trees 1 Example Tree 2 A Generic Tree 3 Tree ADT n Tree definition q A tree is a set of nodes which may be empty q If not empty, then there is a distinguished node r, called root and zero or more nonempty
More information6 March 2007 1. Array Implementation of Binary Trees
Heaps CSE 0 Winter 00 March 00 1 Array Implementation of Binary Trees Each node v is stored at index i defined as follows: If v is the root, i = 1 The left child of v is in position i The right child of
More informationAnalysis of a Search Algorithm
CSE 326 Lecture 4: Lists and Stacks 1. Agfgd 2. Dgsdsfd 3. Hdffdsf 4. Sdfgsfdg 5. Tefsdgass We will review: Analysis: Searching a sorted array (from last time) List ADT: Insert, Delete, Find, First, Kth,
More informationAnalysis of Algorithms I: Binary Search Trees
Analysis of Algorithms I: Binary Search Trees Xi Chen Columbia University Hash table: A data structure that maintains a subset of keys from a universe set U = {0, 1,..., p 1} and supports all three dictionary
More informationData Structures and Data Manipulation
Data Structures and Data Manipulation What the Specification Says: Explain how static data structures may be used to implement dynamic data structures; Describe algorithms for the insertion, retrieval
More informationCS 3410 Ch 19 Binary Search Trees
CS 3410 Ch 19 Binary Search Trees Sections 19.1, 19.319.6 Pages 687697, 702737 Exercises 19 The find operation for a linked list is ( ), which can be prohibitive with a large amount of data. In this
More information1 23 Trees: The Basics
CS10: Data Structures and ObjectOriented Design (Fall 2013) November 1, 2013: 23 Trees: Inserting and Deleting Scribes: CS 10 Teaching Team Lecture Summary In this class, we investigated 23 Trees in
More informationDefinition. E.g. : Attempting to represent a transport link data with a tree structure:
The ADT Graph Recall the ADT binary tree: a tree structure used mainly to represent 1 to 2 relations, i.e. each item has at most two immediate successors. Limitations of tree structures: an item in a tree
More informationTrees & Binary Search Trees
CMSC 132: ObjectOriented Programming II Trees & Binary Search Trees Department of Computer Science University of Maryland, College Park Trees Trees are hierarchical data structures Onetomany relationship
More informationExercises Software Development I. 11 Recursion, Binary (Search) Trees. Towers of Hanoi // Tree Traversal. January 16, 2013
Exercises Software Development I 11 Recursion, Binary (Search) Trees Towers of Hanoi // Tree Traversal January 16, 2013 Software Development I Winter term 2012/2013 Institute for Pervasive Computing Johannes
More informationData Structures and Algorithm Analysis (CSC317) Intro/Review of Data Structures Focus on dynamic sets
Data Structures and Algorithm Analysis (CSC317) Intro/Review of Data Structures Focus on dynamic sets We ve been talking a lot about efficiency in computing and run time. But thus far mostly ignoring data
More informationCS0213 DATA STRUCTURES AND ALGORITHM LAB USING C & C++ LABORATORY MANUAL II  CSE III  SEMESTER ACADEMIC YEAR:
CS0213 DATA STRUCTURES AND ALGORITHM LAB USING C & C++ LABORATORY MANUAL II  CSE III  SEMESTER ACADEMIC YEAR: 20122013 SCHOOL OF COMPUTER SCIENCE & ENGINEERING SRM UNIVERSITY, SRM NAGAR, KATTANKULATHUR603203.
More informationCSC 302 Data Structures and Algorithms with C++
CSC 302 Data Structures and Algorithms with C++ COURSE PARTICULARS Course Code: CSC 302 Course Title: Data Structures and Algorithms with C++ No. of Units: 3 Course Duration: Two hours of theory per week
More informationBinary Search Trees (BST)
Binary Search Trees (BST) 1. Hierarchical data structure with a single reference to node 2. Each node has at most two child nodes (a left and a right child) 3. Nodes are organized by the Binary Search
More informationMerge Sort. 2004 Goodrich, Tamassia. Merge Sort 1
Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Merge Sort 1 DivideandConquer Divideand conquer is a general algorithm design paradigm: Divide: divide the input data S in two disjoint subsets
More informationV.S.B. ENGINEERING COLLEGE, KARUR. Academic Year: (ODD Semester) Department of Computer Science and Engineering
V.S.B. ENGINEERING COLLEGE, KARUR Academic Year: 20162017 (ODD Semester) Department of Computer Science and Engineering Question Bank (2013 Regulations) S.No. Name of the Subject / Lab Semester Page No.
More informationThe Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n1)!
The Tower of Hanoi Recursion Solution recursion recursion recursion Recursive Thinking: ignore everything but the bottom disk. 1 2 Recursive Function Time Complexity Hanoi (n, src, dest, temp): If (n >
More informationAnnouncements. CSE332: Data Abstractions. Lecture 9: B Trees. Today. Our goal. Mary Search Tree. Mary Search Tree. Ruth Anderson Winter 2011
Announcements CSE2: Data Abstractions Project 2 posted! Partner selection due by 11pm Tues 1/25 at the latest. Homework due Friday Jan 28 st at the BEGINNING of lecture Lecture 9: B Trees Ruth Anderson
More informationHeaps & Priority Queues in the C++ STL 23 Trees
Heaps & Priority Queues in the C++ STL 23 Trees CS 3 Data Structures and Algorithms Lecture Slides Friday, April 7, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks
More informationSample Questions Csci 1112 A. Bellaachia
Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k
More informationIntroduction to Data Structures and Algorithms
Introduction to Data Structures and Algorithms Chapter: Elementary Data Structures(1) Lehrstuhl Informatik 7 (Prof. Dr.Ing. Reinhard German) Martensstraße 3, 91058 Erlangen Overview on simple data structures
More informationCOT5405 Analysis of Algorithms Homework 3 Solutions
COT0 Analysis of Algorithms Homework 3 Solutions. Prove or give a counter example: (a) In the textbook, we have two routines for graph traversal  DFS(G) and BFS(G,s)  where G is a graph and s is any
More informationData Structures and Algorithms
Data Structures and Algorithms CS2452016S06 Binary Search Trees David Galles Department of Computer Science University of San Francisco 060: Ordered List ADT Operations: Insert an element in the list
More informationPrevious Lectures. BTrees. External storage. Two types of memory. Btrees. Main principles
BTrees Algorithms and data structures for external memory as opposed to the main memory BTrees Previous Lectures Height balanced binary search trees: AVL trees, redblack trees. Multiway search trees:
More informationAbstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types
EECS 281: Data Structures and Algorithms The Foundation: Data Structures and Abstract Data Types Computer science is the science of abstraction. Abstract Data Type Abstraction of a data structure on that
More informationTREE BASIC TERMINOLOGIES
TREE Trees are very flexible, versatile and powerful nonliner data structure that can be used to represent data items possessing hierarchical relationship between the grand father and his children and
More informationCSE 5311 Homework 2 Solution
CSE 5311 Homework 2 Solution Problem 6.26 Show that the worstcase running time of MAXHEAPIFY on a heap of size n is Ω(lg n). (Hint: For a heap with n nodes, give node values that cause MAX HEAPIFY
More informationTo My Parents Laxmi and Modaiah. To My Family Members. To My Friends. To IIT Bombay. To All Hard Workers
To My Parents Laxmi and Modaiah To My Family Members To My Friends To IIT Bombay To All Hard Workers Copyright 2010 by CareerMonk.com All rights reserved. Designed by Narasimha Karumanchi Printed in
More informationExam study sheet for CS2711. List of topics
Exam study sheet for CS2711 Here is the list of topics you need to know for the final exam. For each data structure listed below, make sure you can do the following: 1. Give an example of this data structure
More informationChapter 4: Linked Lists
Chapter 4: Linked Lists Data Abstraction & Problem Solving with C++ Fifth Edition by Frank M. Carrano Preliminaries Options for implementing an ADT List Array has a fixed size Data must be shifted during
More informationHome Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit
Data Structures Page 1 of 24 A.1. Arrays (Vectors) nelement vector start address + ielementsize 0 +1 +2 +3 +4... +n1 start address continuous memory block static, if size is known at compile time dynamic,
More informationSTACKS,QUEUES, AND LINKED LISTS
STACKS,QUEUES, AND LINKED LISTS Stacks Queues Linked Lists DoubleEnded Queues Case Study: A Stock Analysis Applet 1 Stacks Astack is a container of objects that are inserted and removed according to the
More informationUnit 6: Binary Trees Part 2. Deletion. Deletion by merging. Deletion by merging Deletion by copying. Engineering 4892: Data Structures.
Unit : Binary Trees Part 2 Engineering 92: Data Structures Faculty of Engineering & Applied Science Memorial University of Newfoundland 1 Deletion Deletion by copying 1 Balanced trees AVL trees July 11,
More informationData Structures UNIT III. Model Question Answer
Data Structures UNIT III Model Question Answer Q.1. Define Stack? What are the different primitive operations on Stack? Ans: Stack: A stack is a linear structure in which items may be added or removed
More informationECE242 Data Structures and Algorithms Fall 2008
ECE242 Data Structures and Algorithms Fall 2008 2 nd Midterm Examination (120 Minutes, closed book) Name: SOLUTION_SET Student ID: Question 1 (10) 2 (20) 3 (25) 4 (10) 5 (15) 6 (20) Score NOTE: Any questions
More informationCSCI Trees. Mark Redekopp David Kempe
1 CSCI 104 23 Trees Mark Redekopp David Kempe 2 Properties, Insertion and Removal BINARY SEARCH TREES 3 Binary Search Tree Binary search tree = binary tree where all nodes meet the property that: All
More informationLecture 6b Linked List Variations. Similar but not the same
Lecture 6b Linked List Variations Similar but not the same Linked List Variations: Overview The linked list implementation used in List ADT is known as Singly (Single) Linked List Each node has one pointer
More informationLecture 12 Doubly Linked Lists (with Recursion)
Lecture 12 Doubly Linked Lists (with Recursion) In this lecture Introduction to Doubly linked lists What is recursion? Designing a node of a DLL Recursion and Linked Lists o Finding a node in a LL (recursively)
More informationCS 210 Algorithms and Data Structures College of Information Technology and Engineering Weisberg Division of Engineering and Computer Science
CS 210 Algorithms and Data Structures College of Information Technology and Engineering Weisberg Division of Engineering and Computer Science Semester and Year: Spring 2009 Classroom Section, Meeting Times,
More informationData Structure and Algorithm I Midterm Examination 120 points Time: 9:10am12:10pm (180 minutes), Friday, November 12, 2010
Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am12:10pm (180 minutes), Friday, November 12, 2010 Problem 1. In each of the following question, please specify if the statement
More informationLearning Outcomes. COMP202 Complexity of Algorithms. Binary Search Trees and Other Search Trees
Learning Outcomes COMP202 Complexity of Algorithms Binary Search Trees and Other Search Trees [See relevant sections in chapters 2 and 3 in Goodrich and Tamassia.] At the conclusion of this set of lecture
More informationLinked Lists Linked Lists, Queues, and Stacks
Linked Lists Linked Lists, Queues, and Stacks CSE 10: Introduction to C Programming Fall 200 Dynamic data structure Size is not fixed at compile time Each element of a linked list: holds a value points
More informationQueues Outline and Required Reading: Queues ( 4.2 except 4.2.4) COSC 2011, Fall 2003, Section A Instructor: N. Vlajic
Queues Outline and Required Reading: Queues ( 4. except 4..4) COSC, Fall 3, Section A Instructor: N. Vlajic Queue ADT Queue linear data structure organized according to firstin/firstout (FIFO) principle!
More informationData Structures Using Java
Data Structures Using Java D. S. Malik P. S. Nair THOMSON COURSE TECHNOLOGY Australia Canada Mexico Singapore Spain United Kingdom United States TABLE OF Contents PREFACE XXV 1.Software Engineering Principles
More informationData Structure with C
Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which
More informationQuiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s
Quiz 4 Solutions Q1: What value does function mystery return when called with a value of 4? int mystery ( int number ) { if ( number
More informationNearly Complete Binary Trees and Heaps
Nearly Complete Binary Trees and Heaps DEFINITIONS: i) The depth of a node p in a binary tree is the length (number of edges) of the path from the root to p. ii) The height (or depth) of a binary tree
More informationGUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: 3330704)
GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT Course Curriculum DATA STRUCTURES (Code: 3330704) Diploma Programme in which this course is offered Semester in which offered Computer Engineering,
More informationPersistent Binary Search Trees
Persistent Binary Search Trees Datastructures, UvA. May 30, 2008 0440949, Andreas van Cranenburgh Abstract A persistent binary tree allows access to all previous versions of the tree. This paper presents
More information1.204 Lecture 6. Data structures: stacks, queues, trees, dictionaries. Data structures
1.204 Lecture 6 Data structures: stacks, queues, trees, dictionaries Data structures Correct and efficient representation of data and applicable rules Stack: last in, first out discipline Queue: first
More informationTrees. Chapter 23. Copyright 2012 by Pearson Education, Inc. All rights reserved
Trees Chapter 23 Motivation Tree is a fundamental datastructure Operating Systems: Directory Structure Artificial Intelligence: Game Playing Programs Programming Languages: Inheritance Data Structure:
More informationModesto Junior College Course Outline of Record CMPSC 261
Modesto Junior College Course Outline of Record CMPSC 261 I. OVERVIEW The following information will appear in the 20102011 catalog CMPSC 261 Problem Solving and Programming 2 Prerequisite: Satisfactory
More informationLabworks 1: Binary Search Trees and RedBlack trees
Labworks 1: Binary Search Trees and RedBlack trees October 12, 2016 Deadline for these labworks: October 26 2016 How? Make an archive with the source files of your implementation, and send it by email
More informationCPSC 221 Basic Algorithms and Data Structures
CPSC 221 Basic Algorithms and Data Structures Sorting Textbook References: Koffman: 10.110.4, 10.710.10 EPP 3 rd edition: 9.5 EPP 4 th edition: 11.5 Hassan Khosravi January April 2015 CPSC 221 Sorting
More informationData Structures, Sample Test Questions for the Material after Test 2, with Answers
Data Structures, Sample Test Questions for the Material after Test 2, with Answers 1. Recall the public interfaces of classes List and ListIterator: typedef int ListItemType; class ListIterator{ public:
More informationBTrees. Algorithms and data structures for external memory as opposed to the main memory BTrees. B trees
BTrees Algorithms and data structures for external memory as opposed to the main memory BTrees Previous Lectures Height balanced binary search trees: AVL trees, redblack trees. Multiway search trees:
More information