2014-T2 Lecture 21 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, John Lewis,

Slides:



Advertisements
Similar presentations
COSC2007 Data Structures II Chapter 10 Trees I. 2 Topics Terminology.
Advertisements

ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
2014-T2 Lecture 25 School of Engineering and Computer Science, Victoria University of Wellington  Lindsay Groves, Marcus Frean, Peter Andreae, and Thomas.
CS 171: Introduction to Computer Science II
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
© 2006 Pearson Addison-Wesley. All rights reserved11 A-1 Chapter 11 Trees.
CSC 2300 Data Structures & Algorithms February 6, 2007 Chapter 4. Trees.
Binary Trees Chapter 6.
Chapter 18 - basic definitions - binary trees - tree traversals Intro. to Trees 1CSCI 3333 Data Structures.
Trees Chapter 8. 2 Tree Terminology A tree consists of a collection of elements or nodes, organized hierarchically. The node at the top of a tree is called.
B+ Trees COMP
COMP 103 Introduction to Trees.
Trees. Introduction to Trees Trees are very common in computer science They come in different forms They are used as data representation in many applications.
2014-T2 Lecture 24 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and Thomas.
CS261 Data Structures Trees Introduction and Applications.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
CISC220 Fall 2009 James Atlas Lecture 13: Trees. Skip Lists.
2013-T2 Lecture 22 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and Thomas.
Binary Trees. Binary Tree Finite (possibly empty) collection of elements A nonempty binary tree has a root element The remaining elements (if any) are.
Tree (new ADT) Terminology:  A tree is a collection of elements (nodes)  Each node may have 0 or more successors (called children)  How many does a.
Trees Chapter 8. 2 Tree Terminology A tree consists of a collection of elements or nodes, organized hierarchically. The node at the top of a tree is called.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, VUW B Trees and B+ Trees COMP 261.
Trees CS 105. L9: Trees Slide 2 Definition The Tree Data Structure stores objects (nodes) hierarchically nodes have parent-child relationships operations.
Data Structures TREES.
2014-T2 Lecture 19 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and John.
2013-T2 Lecture 18 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and John.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
2015-T2 Lecture 17 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, John Lewis,
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 6.
M180: Data Structures & Algorithms in Java Trees & Binary Trees Arab Open University 1.
DATA STRUCTURE BS(IT)3rd. Tree An Introduction By Yasir Mustafa Roll No. BS(IT) Bahauddin Zakariya University, Multan.
24 January Trees CSE 2011 Winter Trees Linear access time of linked lists is prohibitive  Does there exist any simple data structure for.
2014-T2 Lecture 29 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae and Thomas.
2015-T2 Lecture 21 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and Thomas.
2015-T2 Lecture 20 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, John Lewis,
2014-T2 Lecture 27 School of Engineering and Computer Science, Victoria University of Wellington  Lindsay Groves, Marcus Frean, Peter Andreae, and Thomas.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
1 The tree data structure Outline In this topic, we will cover: –Definition of a tree data structure and its components –Concepts of: Root, internal, and.
2015-T2 Lecture 19 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and John.
2014-T2 Lecture 18 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, and John.
Chapter 6 – Trees. Notice that in a tree, there is exactly one path from the root to each node.
18-1 Chapter 18 Binary Trees Data Structures and Design in Java © Rick Mercer.
2015-T2 Lecture 28 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae and Thomas.
Trees A non-linear implementation for collection classes.
(c) University of Washington20-1 CSC 143 Java Trees.
COMP 103 Binary Search Trees II Marcus Frean 2014-T2 Lecture 26
CSE 373 Data Structures Lecture 7
Lecture 1 (UNIT -4) TREE SUNIL KUMAR CIT-UPES.
Fundamentals of Programming II Introduction to Trees
COMP 103 Linked Structures Marcus Frean 2014-T2 Lecture 17
COMP 103 Introduction to Trees Thomas Kuehne 2013-T2 Lecture 19
COMP 103 Tree Traversals Lindsay Groves 2016-T2 Lecture 22
Objective: Understand Concepts related to trees.
COMP 103 Sorting with Binary Trees: Tree sort, Heap sort Alex Potanin
COMP 103 HeapSort Thomas Kuehne 2013-T1 Lecture 27
Binary Search Trees (I)
Depth-first vs breadth-first traversals
Tonga Institute of Higher Education
COSC2100: Data Structures and Algorithms
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Trees Slides are adopted from “Discrete.
Week nine-ten: Trees Trees.
Trees (Part 1, Theoretical)
Lecture 36 Section 12.2 Mon, Apr 23, 2007
Copyright ©2012 by Pearson Education, Inc. All rights reserved
CSC 143 Java Trees.
CS210- Lecture 9 June 20, 2005 Announcements
Binary Trees.
Trees.
Cs212: Data Structures Lecture 7: Tree_Part1
Presentation transcript:

2014-T2 Lecture 21 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, Peter Andreae, John Lewis, and Thomas Kuehne, VUW COMP 103 Marcus Frean “Various topics”

2 RECAP  Linked lists  Trees TODAY  Don’t want to rush into trees Announcements  No lecture this Thursday

3  Generalised LinkedNode Representing trees in Java M Linked List Nodes FC

4  Generalised LinkedNode Representing trees in Java Binary Tree Nodes M FCTL

5  Generalised LinkedNode Representing trees in Java General Tree Nodes F … … … C … … … M … … … T … … … L … … … some collection type (ordered or unordered)

6 More Tree Examples  Other Taxonomies  e.g. game genres  Organisational Charts  CEO, managers, employees, slaves, …  Filing systems  e.g., the folder structure of your hard drive  Computer Graphics models   Octrees, for partitioning 3D space  Decision processes …… hierarchical structures naturally represented with trees (rather than using trees as an access technique) hierarchical structures naturally represented with trees (rather than using trees as an access technique)

7 Planning  Tic Tac Toe  search tree for moves XXX XXX … OXOXX O X O X O X O … often not represented explicitly; only implicitly “created” by recursion

8 More Tree Terminology  A tree is a collection of items in a strict hierarchical structure.  Each item is in a node of the tree.  The root is at the top.  The leaves are at the bottom.  Each node may have child nodes – except a leaf, which has none.  Each node has one parent - except the root, which has none.  An edge joins a node to its parent – may be labelled.  A subtree is a node plus all its descendents.  The depth of a node is its distance from the root.  The height or depth of a tree is the depth of the lowest leaf.  Level = set/list of nodes at the same depth.  Branch = sequence of nodes on a path from root to a leaf. Children may be ordered/unordered Tree may or may not store explicit parent references

9 Terminology visualised K K G G C C I I M M Q Q O O A A E E node, root, leaf, child, parent, edge, subtree, depth, height, level, branch, siblings, ancestors, descendants, cousins, …

10 remember that test? I see there are lots of scripts uncollected:  if you haven’t already, pick up your script from the office on the 3 rd floor  Check our addition...  Look at the solutions and make sure you understand everything  Our answer for Q3c was wrong – we’ll give everyone who sat the test those marks.

11 processing.org  “processing” is a programming environment that you might enjoy exploring...  write in java: processing takes care of most of the “icky stuff” (such as main...).  end result can be run in a web page

12 python  python is a programming language that you might enjoy exploring...  “scripting” language – interpreted, not compiled  not “strongly typed” (whereas Java is)  fast to write  avoid loops.... but numpy  graphics via pylab library  FightClub...