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

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

Cpt S 122 Data Structures. Data Structures Trees

Chapter 20: Binary Trees

DEEPIKA KAMBOJ UNIT 2. What is Stack?

Binary Trees

Trees. CSE 373 Data Structures

Computational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs

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

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

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

Computer Organisation IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

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?

Data Structures Question Bank Multiple Choice

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

Binary Trees, Binary Search Trees

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

Summer Final Exam Review Session August 5, 2009

Lecture 26. Introduction to Trees. Trees

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

CSE 373 Spring Midterm. Friday April 21st

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

CSI33 Data Structures

Computational thinking, problem-solving and programming:

Binary Search Trees Treesort

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

Computer science Higher level Paper 1

Resource Management IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

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

Associate Professor Dr. Raed Ibraheem Hamed

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

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

Algorithms in Systems Engineering ISE 172. Lecture 16. Dr. Ted Ralphs

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

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

Visit ::: Original Website For Placement Papers. ::: Data Structure

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

12 Abstract Data Types

1. Two main measures for the efficiency of an algorithm are a. Processor and memory b. Complexity and capacity c. Time and space d.

Code No: R Set No. 1

Programming II (CS300)

Stacks, Queues and Hierarchical Collections

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

Operations on Heap Tree The major operations required to be performed on a heap tree are Insertion, Deletion, and Merging.

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

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

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

Department of Computer Science and Technology

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

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

3137 Data Structures and Algorithms in C++

Recursive Data Structures and Grammars

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

COSC 2011 Section N. Trees: Terminology and Basic Properties

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

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

CompSci 201 Tree Traversals & Heaps

Why Do We Need Trees?

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

CS301 - Data Structures Glossary By

Definitions A A tree is an abstract t data type. Topic 17. "A tree may grow a. its leaves will return to its roots." Properties of Trees

INF2220: algorithms and data structures Series 1

CS24 Week 8 Lecture 1

Data Structures and Algorithms

1. Which of the following circuits can be used to store one bit of data? A) Encoder B) OR gate C) Flip Flop D) Decoder

DATA STRUCTURES THROUGH C++

ROOT A node which doesn t have a parent. In the above tree. The Root is A. LEAF A node which doesn t have children is called leaf or Terminal node.

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

Programming II (CS300)

INF2220: algorithms and data structures Series 1

CSI33 Data Structures

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

DS ata Structures Aptitude

CS 240 Fall Mike Lam, Professor. Priority Queues and Heaps

Introduction. for large input, even access time may be prohibitive we need data structures that exhibit times closer to O(log N) binary search tree

Postfix (and prefix) notation

Readings. Priority Queue ADT. FindMin Problem. Priority Queues & Binary Heaps. List implementation of a Priority Queue

DATA STRUCTURES AND ALGORITHMS. Hierarchical data structures: AVL tree, Bayer tree, Heap

Course Review. Cpt S 223 Fall 2009

Advanced Tree Data Structures

Implementations. Priority Queues. Heaps and Heap Order. The Insert Operation CS206 CS206

Programming II (CS300)

Announcements. Midterm exam 2, Thursday, May 18. Today s topic: Binary trees (Ch. 8) Next topic: Priority queues and heaps. Break around 11:45am

Sample Exam 1 Questions

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 154) Pass Marks: 24

March 20/2003 Jayakanth Srinivasan,

Analysis of Algorithms

Trees. Tree Structure Binary Tree Tree Traversals

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

Definition of a tree. A tree is like a binary tree, except that a node may have any number of children

Friday Four Square! 4:15PM, Outside Gates

Trees. A tree is a directed graph with the property

Chapter 11.!!!!Trees! 2011 Pearson Addison-Wesley. All rights reserved 11 A-1

Chapter 11.!!!!Trees! 2011 Pearson Addison-Wesley. All rights reserved 11 A-1

Data Structures in C++ Using the Standard Template Library

Unit 8: Analysis of Algorithms 1: Searching

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

Topic 18 Binary Trees "A tree may grow a thousand feet tall, but its leaves will return to its roots." -Chinese Proverb

Transcription:

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

HL Topics 1-7, D1-4 1: System design 2: Computer Organisation 3: Networks 4: Computational thinking 5: Abstract data structures 6: Resource management 7: Control D: OOP

1: System design HL only 5 Overview Thinking recursively 5.1.1 Identify a situation that requires the use of recursive thinking 5.1.2 Identify recursive thinking in a specified problem solution 5.1.3 Trace a recursive algorithm to express a solution to a problem Abstract data structures 5.1.4 Describe the characteristics of a two-dimensional array 5.1.5 Construct algorithms using two-dimensional arrays 5.1.6 Describe the characteristics and applications of a stack 5.1.7 Construct algorithms using the access methods of a stack 5.1.8 Describe the characteristics and applications of a queue 5.1.9 Construct algorithms using the access methods of a queue 5.1.10 Explain the use of arrays as static stacks and queues Linked lists 5.1.11 Describe the features and characteristics of a dynamic data structure 5.1.12 Describe how linked lists operate logically 5.1.13 Sketch linked lists (single, double and circular) Trees 5.1.14 Describe how trees operate logically (both binary and non-binary) 5.1.15 Define the terms: parent, left-child, right-child, subtree, root and leaf 5.1.16 State the result of inorder, postorder and preorder tree traversal 5.1.17 Sketch binary trees Applications 5.1.18 Define the term dynamic data structure 5.1.19 Compare the use of static and dynamic data structures 5.1.20 Suggest a suitable structure for a given situation 2: Computer Organisation 4: Computational thinking 6: Resource management D: OOP 3: Networks 5: Abstract data structures 7: Control

Topic 5.1.20 Suggest a suitable structure for a given situation

Abstract Data Structures (ADTs) 2D array Stack Queue Linked List (Binary) Tree Recursion

Stacks? Best used for: Perhaps the most important application of stacks is to implement function calls (methods). Most compilers implement function calls by using a stack. This also provides a technique for eliminating recursion from a program: instead of calling a function recursively, the programmer uses a stack to simulate the function calls in the same way that the compiler would have done so. Conversely, we can often use recursion instead of using an explicit stack.

Queues? Best used for: Computing applications: serving requests of a single shared resource (printer, disk, CPU), Buffers: MP3 players and portable CD players, ipod playlist. Playlist for jukebox: add songs to the end, play from the front of the list. Interrupt handling: When programming a real-time system that can be interrupted (e.g., by a mouse click or wireless connection), it is necessary to attend to the interrupts immediately, before proceeding with the current activity. If the interrupts should be handles in the same order they arrive, then a FIFO queue is the appropriate data structure.

Linked list? Best when: You need constant-time insertions/deletions from the list (such as in real-time computing where time predictability is absolutely critical) You don't know how many items will be in the list. With arrays, you may need to re-declare and copy memory if the array grows too big You don't need random access to any elements You want to be able to insert items in the middle of the list (such as a priority queue)

Arrays? Best when: You need indexed/random access to elements You know the number of elements in the array ahead of time so that you can allocate the correct amount of memory for the array You need speed when iterating through all the elements in sequence. Memory is a concern. Filled arrays take up less memory than linked lists. Each element in the array is just the data. Each linked list node requires the data as well as one (or more) pointers to the other elements in the linked list.

Binary trees? Best for: Binary Search Tree - Used in many search applications where data is constantly entering/leaving, such as the map and set objects in many languages' libraries. Heaps - Used in implementing efficient priority-queues, which in turn are used for scheduling processes in many operating systems, Quality-of-Service in routers, and A* (path-finding algorithm used in AI applications, including robotics and video games). Also used in heap-sort. GGM Trees - Used in cryptographic applications to generate a tree of pseudo-random numbers. Syntax Tree - Constructed by compilers and (implicitly) calculators to parse expressions.