DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.

Slides:



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

DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
Introduction to Trees Chapter 6 Objectives
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Data Structures: Trees i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, or Glenn Brookshear.
CS2420: Lecture 13 Vladimir Kulyukin Computer Science Department Utah State University.
Chapter 4: Trees General Tree Concepts Binary Trees Lydia Sinapova, Simpson College Mark Allen Weiss: Data Structures and Algorithm Analysis in Java.
1 Trees. 2 Outline –Tree Structures –Tree Node Level and Path Length –Binary Tree Definition –Binary Tree Nodes –Binary Search Trees.
© 2006 Pearson Addison-Wesley. All rights reserved11 A-1 Chapter 11 Trees.
CHAPTER 12 Trees. 2 Tree Definition A tree is a non-linear structure, consisting of nodes and links Links: The links are represented by ordered pairs.
Binary Trees Chapter 6.
COSC2007 Data Structures II
Chapter 8: Data Abstractions Senem Kumova Metin. 8-2 Chapter 8: Data Abstractions 8.1 Basic Data Structures – Arrays – Lists, Stacks, Queues – Trees 8.2.
Introduction Of Tree. Introduction A tree is a non-linear data structure in which items are arranged in sequence. It is used to represent hierarchical.
12-CRS-0106 REVISED 8 FEB 2013 CSG2A3 ALGORITMA dan STRUKTUR DATA.
Binary Trees. Binary Tree Finite (possibly empty) collection of elements A nonempty binary tree has a root element The remaining elements (if any) are.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
Chapter 8 Data Abstractions. © 2005 Pearson Addison-Wesley. All rights reserved 8-2 Chapter 8: Data Abstractions 8.1 Data Structure Fundamentals 8.2 Implementing.
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.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Trees By P.Naga Srinivasu M.tech,(MBA). Basic Tree Concepts A tree consists of finite set of elements, called nodes, and a finite set of directed lines.
Discrete Mathematics Chapter 5 Trees.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
M180: Data Structures & Algorithms in Java Trees & Binary Trees Arab Open University 1.
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
TREES General trees Binary trees Binary search trees AVL trees Balanced and Threaded trees.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
Chapter 6 – Trees. Notice that in a tree, there is exactly one path from the root to each node.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
Trees A non-linear implementation for collection classes.
Tree Representation and Terminology Binary Trees Binary Search Trees Pointer-Based Representation of a Binary Tree Array-Based Representation of a Binary.
TREES From root to leaf. Trees  A tree is a non-linear collection  The elements are in a hierarchical arrangement  The elements are not accessible.
Lecture 1 (UNIT -4) TREE SUNIL KUMAR CIT-UPES.
Presented By: Mahmoud Rafeek Alfarra
CISC220 Fall 2009 James Atlas Lecture 13: Binary Trees.
Objective: Understand Concepts related to trees.
Section 8.1 Trees.
Chapter 8: Data Abstractions
i206: Lecture 13: Recursion, continued Trees
Binary Trees, Binary Search Trees
TREES General trees Binary trees Binary search trees AVL trees
CS223 Advanced Data Structures and Algorithms
COSC2100: Data Structures and Algorithms
Introduction To Programming Information Technology , 1’st Semester
Presented By: Mahmoud Rafeek Alfarra
Data Structures: Trees and Binary Trees
Trees Definitions Implementation Traversals K-ary Trees
Introduction To Programming Information Technology , 1’st Semester
Presented By: Mahmoud Rafeek Alfarra
Lecture 36 Section 12.2 Mon, Apr 23, 2007
Binary Trees, Binary Search Trees
Trees.
Presented By: Mahmoud Rafeek Alfarra
Introduction To Programming Information Technology , 1’st Semester
Tree.
Chapter 20: Binary Trees.
Binary Trees.
Tree and its terminologies
General Tree Concepts Binary Trees
Presented By: Mahmoud Rafeek Alfarra
Binary Trees, Binary Search Trees
Trees.
Cs212: Data Structures Lecture 7: Tree_Part1
Presentation transcript:

DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Information Technology, 3’rd Semester Lecture 13: Trees

Outline  Classification of Data Structures  The definition of a tree  Terminology of Tree  Binary Trees  Binary Search Tree  Emank X Mezank !!

Classification of Data Structures 3 Presented & Prepared by: Mahmoud R. Alfarra ClassificationLinearHierarchical

The definition of a tree  A tree is a set of nodes connected by edges. An example of a tree is a company’s organization chart 4 Presented & Prepared by: Mahmoud R. Alfarra

The definition of a tree 5 Presented & Prepared by: Mahmoud R. Alfarra  The purpose of an organization chart is to communicate to the viewer the structure of the organization. leaf nodes root node internal nodes

Terminology of Tree 6 Presented & Prepared by: Mahmoud R. Alfarra  Tree: A collection of data whose entries have a hierarchical organization  Node: An entry in a tree  Root node: The node at the top  Terminal or leaf node: A node at the bottom

Terminology of Tree 7 Presented & Prepared by: Mahmoud R. Alfarra  Parent: The node immediately above a specified node  Child: A node immediately below a specified node  Ancestor: Parent, parent of parent, etc.  Descendent: Child, child of child, etc.  Siblings: Nodes sharing a common parent

Terminology of Tree 8 Presented & Prepared by: Mahmoud R. Alfarra  Binary tree: A tree in which every node has at most two children  Depth: The number of nodes in longest path from root to leaf

Terminology of Tree 9 Presented & Prepared by: Mahmoud R. Alfarra

Binary Trees 10 Presented & Prepared by: Mahmoud R. Alfarra  Tree nodes contain two or more links  Most of other data structures we have discussed only contain one  In Binary trees  All nodes contain two links  None, one, or both of which may be NULL  The root node is the first node in a tree.  Each link in the root node refers to a child  A node with no children is called a leaf node

Binary Trees 11 Presented & Prepared by: Mahmoud R. Alfarra  Allow the head (and the rear) to be moving targets B A D C

Binary Tree Definitions 12 Presented & Prepared by: Mahmoud R. Alfarra  Leaf: node that has no left and right children  Parent: node with at least one child node  Level of a node: number of branches on the path from root to node  Height of a binary tree: number of nodes no the longest path from root to node

Binary Tree Implementation Logic 13 Presented & Prepared by: Mahmoud R. Alfarra  Leaf: node that has no left and right children  Parent: node with at least one child node  Level of a node: number of branches on the path from root to node  Height of a binary tree: number of nodes no the longest path from root to node

Binary search trees 14 Presented & Prepared by: Mahmoud R. Alfarra Binary search trees Not a binary search tree

Emank X Mezank !! أعظم أسبـاب النجاة استعن بالله

Next Lecture Examples (Implementation of tree and then Practices )