Confidential1 Tree Diagrams. Confidential2 Warm Up Find the lower and upper quartiles of the following data sets 1.23, 25, 27, 29, 31, 33, 35 2. 49, 51,

Slides:



Advertisements
Similar presentations
Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
Advertisements

Binary Trees CSC 220. Your Observations (so far data structures) Array –Unordered Add, delete, search –Ordered Linked List –??
IB Math Studies – Topic 6 Statistics.
Unit 32 STATISTICS.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
© 2006 Pearson Addison-Wesley. All rights reserved11 A-1 Chapter 11 Trees.
B a c kn e x t h o m e Classification of Variables Discrete Numerical Variable A variable that produces a response that comes from a counting process.
Confidential2 Warm Up 1.Tossing a quarter and a nickel HT, HT, TH, TT; 4 2. Choosing a letter from D,E, and F, and a number from 1 and 2 D1, D2, E1, E2,
Data Structures Using C++ 2E Chapter 11 Binary Trees and B-Trees.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 20: Binary Trees.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Trees.
Binary Trees Chapter 6.
Descriptive Statistics  Summarizing, Simplifying  Useful for comprehending data, and thus making meaningful interpretations, particularly in medium to.
Confidential2 Warm Up 1.Tossing a quarter and a nickel 2. Choosing a letter from D,E, and F, and a number from 1 and 2 3.Choosing a tuna, ham, or egg.
Bell Ringer Get out your notebook and prepare to take notes on Chapter 9 Convert your height to inches and be prepared to write this value on the whiteboard.
Census A survey to collect data on the entire population.   Data The facts and figures collected, analyzed, and summarized for presentation and.
Tree.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Review of Probability Grade 6 Copyright © Ed2Net Learning Inc.1.
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.
 Frequency Distribution is a statistical technique to explore the underlying patterns of raw data.  Preparing frequency distribution tables, we can.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 10: Trees Data Abstraction & Problem Solving with C++
Topic 14 The BinaryTree ADT Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms.
Trees CSC 172 SPRING 2002 LECTURE 14. Lists We have seen lists: public class Node { Object data; Node next; } 
Chapter 2 Describing Data.
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.
Data Structures and Algorithms Lecture (BinaryTrees) Instructor: Quratulain.
0-13: Representing Data.
Line Graph Bar Graph. Confidential2 Warm Up Find the range for each set of data. Choose an appropriate set and interval for a frequency table 1.8, 2,
Trees CS 105. L9: Trees Slide 2 Definition The Tree Data Structure stores objects (nodes) hierarchically nodes have parent-child relationships operations.
Displaying Distributions with Graphs. the science of collecting, analyzing, and drawing conclusions from data.
P(A). Ex 1 11 cards containing the letters of the word PROBABILITY is put in a box. A card is taken out at random. Find the probability that the card.
Copyright © Ed2Net Learning Inc.1 Graphing in four Quadrants.
BAR GRAPH Bar Graph: Uses bars to show quantities or numbers for comparison.
Review 1 Queue Operations on Queues A Dequeue Operation An Enqueue Operation Array Implementation Link list Implementation Examples.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Introduction to Trees IT12112 Lecture 05 Introduction Tree is one of the most important non-linear data structures in computing. It allows us to implement.
Discrete Mathematics Chapter 5 Trees.
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.
Lecture 17: Trees and Networks I Discrete Mathematical Structures: Theory and Applications.
Trees Chapter 10. CS 308 2Chapter Trees Preview: Preview: The data organizations presented in previous chapters are linear, in that items are one.
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
Preparing for Algebra Chapter Plan for Problem Solving Pg. P5-P6 Obj: Learn how to use the four-step problem- solving plan.
CMSC 202, Version 5/02 1 Trees. CMSC 202, Version 5/02 2 Tree Basics 1.A tree is a set of nodes. 2.A tree may be empty (i.e., contain no nodes). 3.If.
Graphs and Trees Mathematical Structures for Computer Science Chapter 5 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesGraphs and Trees.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
Trees By JJ Shepherd. Introduction Last time we discussed searching and sorting in a more efficient way Divide and Conquer – Binary Search – Merge Sort.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
(c) University of Washington20-1 CSC 143 Java Trees.
DATA STRUCURES II CSC QUIZ 1. What is Data Structure ? 2. Mention the classifications of data structure giving example of each. 3. Briefly explain.
1 Trees. 2 Trees Trees. Binary Trees Tree Traversal.
Example 1A: Using the Fundamental Counting Principle
Trees Chapter 15.
Data Structure and Algorithms
Chapter 5 : Trees.
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Tree.
Section 8.1 Trees.
CS223 Advanced Data Structures and Algorithms
Introduction to Trees IT12112 Lecture 05.
Section Ii: statistics
Trees.
Chapter 20: Binary Trees.
Find the Mean of the following numbers.
Data Structures Using C++ 2E
Chapter 11 Trees © 2011 Pearson Addison-Wesley. All rights reserved.
Presentation transcript:

Confidential1 Tree Diagrams

Confidential2 Warm Up Find the lower and upper quartiles of the following data sets 1.23, 25, 27, 29, 31, 33, , 51, 53, 55, 57, 59, 61 Find the mean, median and mode for the data sets , 3100, 300, 3000, , 4.2, 4.0, 4.2, 4.2

Confidential3 Warm Up Make a back-to-back stem-and-leaf plot to compare the birth dates of Mrs. Jenson’s students. Boys- 22, 18, 9, 3, 5, 28, 11 Girls- 9, 3, 8, 27, 15, 6, 31 5.

Confidential4 1. In the raw data, there can be repetitions of observations. The number of times a particular observation repeats itself is called its frequency. 2. When the number of observation is limited, Tally Marks are used to find the frequencies. Tallies are usually marked in bunches of five for ease in Counting 3. When the number of observations is very large, the data is usually organized into groups called class intervals and the data obtained is called the grouped data. 4. A Stem and Leaf Plot is a type of graph that summarizes the shape of a set of data (the distribution) and provides extra detail regarding individual values. Lets recap our last lesson

Confidential5 1.Graphs are pictorial representation for a set of data ranges. 2.Graphs can be of different types - Line graph and Bar graph 3. Data Representation on the Graph is Labels Mean - The average of a group of numbers is called the mean Median- It is the number present in the middle when the numbers in a set of data are arranged in ascending or descending order Mode-The number that appears the most often in a listing of number

Confidential6  A box and whisker plot is used to display a set of data.  To create this plot we first find out median, first quartile and second quartile.  Plot the given data set on a number line.  Mark the highest and lowest data points with connected black circles and make a box between the quartiles and a line through the median. Box-and-whisker plots and Circle Graphs

Confidential7 1) Sampling is the art of learning about a very large group of people by getting information from a small set of people. 2) Population is the entire set of individuals, events, units with specified characteristics. 3) Parameter is a summary description of a particular aspect of the entire population. 4) Sample is the subset of the population from which data is collected and used as a basis for making statements about the entire population.

Confidential8 Nodes A node may contain a value or a condition or represents a separate data structure or a tree of its own. Each node in a tree has zero or more child nodes, which are below it in the tree Let us start We use Tree diagrams to count the possible outcomes of any problem of probability, as well as analyze games of choice.

Confidential9 More on Nodes A node that has a child is called the child's Parent node (or ancestor node, or superior). A node has at most one parent. The height of a node is the length of the longest downward path to a leaf from that node. The height of the root is the height of the tree. The depth of a node is the length of the path to its root.

Confidential10 Root nodes The topmost node in a tree is called the root node. Being the topmost node, the root node will not have parents. It is the node at which operations on the tree commonly begin. Every node in a tree can be seen as the root node of the sub-tree rooted at that node.

Confidential11 Leaf nodes Nodes at the bottommost level of the tree are called leaf nodes. Since they are at the bottommost level, they do not have any children.

Confidential12 Internal nodes An internal node or inner node is any node of a tree that has child nodes and is thus not a leaf node

Confidential13 Sub tree A Sub tree is a portion of a tree data structure that can be viewed as a complete tree in itself. Any node in a tree T, together with all the nodes below it, comprise a Sub tree of T.

Confidential14 More on Sub Tree The Sub tree corresponding to the root node is the entire tree. The Sub tree corresponding to any other node is called a Proper Sub tree

Confidential15 Tree ordering There are two basic types of trees.  Unordered Tree  Ordered Tree

Confidential16 Unordered Tree  In an unordered tree, a tree is a tree in a purely structural sense —  that is to say, given a node, there is no order for the children of that node.

Confidential17 Ordered Tree A tree on which an order is imposed — ordered Tree. for example, by assigning different natural numbers to each edge leading to a node's children — is called an edge-labeled tree or an ordered tree.

Confidential18 Forest A Forest is an ordered set of ordered trees. In order, preorder and post order traversals are defined recursively for forest

Confidential19 Let us Study Traversal of Trees  In order  Preorder  Post order

Confidential20 In order Traverse in-order the forest formed by the sub-trees of the first tree in the forest, if any. Visit the root of the first tree. Traverse in-order the forest formed by the remaining trees in the forest, if any.

Confidential21 Preorder Visit the root of the first tree. Traverse preorder the forest formed by the sub trees of the first tree in the forest, if any. Traverse preorder the forest formed by the remaining trees in the forest, if any.

Confidential22 Post order Traverse post order the forest formed by the sub trees of the first tree in the forest, if any. Traverse post order the forest formed by the remaining trees in the forest, if any. Visit the root of the first tree.

Confidential23 Tree representations Common representations represent the nodes as records allocated on the heap with pointers to their children, their parents, or both, or as items in an array, with relationships between them determined by their positions in the array (e.g., binary heap).

Confidential24 Trees as graphs In graph theory, a tree is a connected acyclic graph. A rooted tree is such a graph with a vertex singled out as the root. In this case, any two vertices connected by an edge inherit a parent-child relationship. An acyclic graph with multiple connected components or a set of rooted trees is sometimes called a forest.

Confidential25 Traversal methods Stepping through the items of a tree, by means of the connections between parents and children, is called walking the tree, and the action is a walk of the tree. Often, an operation might be performed when a pointer arrives at a particular node.

Confidential26 Preorder And Post order Walk A walk in which each parent node is traversed before its children is called a pre-order walk; A walk in which the children are traversed before their respective parents are traversed is called a post- order walk.

Confidential27 Common operations Enumerating all the items Searching for an item Adding a new item at a certain position on the tree Deleting an item Removing a whole section of a tree (called pruning) Adding a whole section to a tree (called grafting) Finding the root for any node

Confidential28 A family has three children. How many outcomes are in the sample space that indicates the sex of the children? Assume that the probability of male (M) and the probability of female (F) are each 1/2. Sample space: { MMF MFM MFF FMM FMF FFMFFF MMM } There are 8 outcomes in the sample space. The probability of each outcome is 1/2 1/2 1/2 = 1/8. Example

Confidential29 Tree diagram

Confidential30 1.Draw tree structure for Alphabets from A to I Assessment

Confidential31 2. Implement sub tree for tree. 3. Mention the tree is ordered or not.

Confidential32 4. Mention preorder traversal. 5. Mention post order traversal. 6. Mention in order traversal.

Confidential33 7.Find leaf nodes 8.Find the preorder walk of the tree

Confidential34 9. Find post order walk of the tree. 10 Mention level order sequencing

Confidential35 1. Make a tree diagram and list the outcomes A B C Spinning the spinner and choosing a card

Confidential36 2. Show the sample space for tossing one penny and rolling one die. (H = heads, T = tails)

Confidential37 3. Draw A tree Structure in implementing the hierarchy of developing triangle hint : figure…polygon…triangle …… types of triangle

Confidential38 Lets recap what we have learned in this lesson There are two basic types of trees. Unordered Tree Ordered Tree In an unordered tree, a tree is a tree in a purely structural sense A tree on which an order is imposed — ordered Tree A node may contain a value or a condition or represents a separate data structure or a tree of its own. Each node in a tree has zero or more child nodes, which are below it in the tree

Confidential39 A Sub tree is a portion of a tree data structure that can be viewed as a complete tree in itself A Forest is an ordered set of ordered trees Traversal of Trees In order Preorder Post order In graph theory, a tree is a connected acyclic graph.

Confidential40 Preorder And Post order Walk A walk in which each parent node is traversed before its children is called a pre-order walk; A walk in which the children are traversed before their respective parents are traversed is called a post-order walk.

Confidential41