BINARY TREES - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

BINARY TREES

Description:

A Binary Tree where the data in each node is ordered in a particular way. For any ... http://www.ibr.cs.tu-bs.de/courses/ss98/audii/applets/BST/BST-Example.html ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 10
Provided by: Mar8399
Category:
Tags: binary | trees | bst

less

Transcript and Presenter's Notes

Title: BINARY TREES


1
BINARY TREES
2
What is a Binary Tree?
  • A Tree Data structure (ie. Upside Down) in which
    each node has at most 2 children.
  • Each child is clearly identified as either the
    LEFT or RIGHT child.

3
Some Terminology
ROOT NODE
Parent
Ancestors
Child
Siblings
4
Some More Terminology
Segment
Branch Sequence of Nodes
Internal Nodes
Height of Tree Length of longest Branch
Leaves External Nodes
5
Have a Go
ROOT NODE
Segments
Nodes
Right Children
6
Binary Search Trees
  • A Binary Tree where the data in each node is
    ordered in a particular way.
  • For any given node
  • data in any nodes of the LEFT subtree must be
    LESS
  • data in any nodes of the RIGHT subtree must be
    GREATER
  • http//www.ibr.cs.tu-bs.de/courses/ss98/audii/appl
    ets/BST/BST-Example.html

7
Binary Tree Traversals
  • To Recursively visit each node in the left and
    right subtrees and examine the value.
  • Different Types of Traversals
  • Inorder
  • Preorder
  • Postorder
  • http//nova.umuc.edu/jarc/idsv/lesson1.html

8
The Uses of a Binary Tree
  • Sort Routine The different traversal mechanism
    will determine the nature of the sort.
  • Storing data items for fast lookup.
  • Data can be stored in
  • Pointer based implementations
  • Tables
  • Arrays with implicit data structure

9
And Finally............
Write a Comment
User Comments (0)
About PowerShow.com