C241 PLTL SESSION – 2/22/2015 Graph Theory & Binary Search Trees.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

Chapter 12 Sorting and searching. This chapter discusses n Two fundamental list operations. u Sorting u Searching n Sorted lists. n Selection/bubble sort.
Nested Quantifiers Needed to express statements with multiple variables Example 1: “x+y = y+x for all real numbers”  x  y(x+y = y+x) where the domains.
The Logic of Quantified Statements
Simple Graph Warmup. Cycles in Simple Graphs A cycle in a simple graph is a sequence of vertices v 0, …, v n for some n>0, where v 0, ….v n-1 are distinct,
Lower Bounds for Sorting, Searching and Selection
CS 285- Discrete Mathematics
Optimal Binary Search Tree
EECS 311: Chapter 4 Notes Chris Riesbeck EECS Northwestern.
Data Structures: Trees i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, or Glenn Brookshear.
1 /26 Red-black tree properties Every node in a red-black tree is either black or red Every null leaf is black No path from a leaf to a root can have two.
For Friday, read chapter 6, section 2. As nongraded HW, do the problems on p Graded Homework #7 is due on Friday at the beginning of class.
CS 206 Introduction to Computer Science II 11 / 09 / 2009 Instructor: Michael Eckmann.
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
C241 PLTL SESSION – 2/10/2015 More Proofs & More Graphs.
C241 PLTL SESSION – 3/3/2015 Relations & Graph Theory.
C241 PLTL SESSION – 3/1/2015 Functions & Relations.
C241 PLTL SESSION – 2/24/2015 Set Theory & Functions.
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
QUIETLY, COMPLETE ANAYLZING HOUSING WORKSHEET
GRAPHING EQUATIONS OF LINES
Relations and Functions
Graph 8 a. Graph b. Domain _________ c. Range __________
Exponential Growth & Decay Objective: Be able to graph and find equations of exponential equations. TS: Explicitly assess information and draw conclusions.
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
Exponential Growth & Decay Objective: Be able to graph and find equations of exponential equations. TS: Explicitly assess information and draw conclusions.
Warm-Up Multiply the following: 1) 2) 3) Math II UNIT QUESTION: What methods can be used to find the inverse of a function? Standard: MM2A2, MM2A5 Today’s.
Functions and Graphs An introduction and overview.
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
R Functions in one variable can be represented by a graph. R Each ordered pair (x, f(x)) that makes the equation true is a point on the graph. R Graph.
1 Binary Trees Informal defn: each node has 0, 1, or 2 children Informal defn: each node has 0, 1, or 2 children Formal defn: a binary tree is a structure.
Algebra I Pre-AP Objectives: Objectives: By the end of today I will be prepared for the test Warm-Up: Draw a line that has the following slopes: -2/30undefined.
Warmups Find the slope. 1. (2, -5) (3, 1) 2. (-6, 4) (3, 7) Solve: 3. 4.
Comp 335 File Structures B - Trees. Introduction Simple indexes provided a way to directly access a record in an entry sequenced file thereby decreasing.
Lesson Topic: Drawing Polygons on the Coordinate Plane Lesson Objective: I can…  Given coordinates for the vertices, I can draw polygons in the coordinate.
Warm-Up Solve the following Inequalities:
lds revisited (aka chinese whispers) Send reinforcements. We’re going to advance.
WARM-UP: USE YOUR GRAPHING CALCULATOR TO GRAPH THE FOLLOWING FUNCTIONS Look for endpoints for the graph Describe the direction What is the shape of the.
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
Math 10 Functions Unit Lesson (6) Table of values.
LESSON 19: UNDERSTANDING VARIABILITY IN ESTIMATES Student Outcomes Students understand the term sampling variability in the context of estimating a population.
Unit 2 Review. What does the graph tell you???? What is the Domain What is the range What is the y intercept What are the relative max and mins, absolute.
Recitation 3 (Heap Sort and Binary Search Tree)
Binary Search Tree (BST)
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
8-1: Relations and Functions
Section 3.6 Functions.
Chapter 10.1 Binary Search Trees
i206: Lecture 13: Recursion, continued Trees
Teaching KS3 Computing Session 4 Theory: Boolean logic AND/OR/NOT
Graphing Linear Inequalities.
Teaching KS3 Computing Session 4 Theory: Boolean logic AND/OR/NOT
كلية المجتمع الخرج البرمجة - المستوى الثاني
Exponential Growth & Decay
إعداد وتقديم الخبيرة التربوية
Searching and BST Exercises
Discrete Math (2) Haiming Chen Associate Professor, PhD
Unit-4: Dynamic Programming
Determining an Equation of a Line
Search Exercise Search Tree? Solution (Breadth First Search)?
Binary Trees: Motivation
Straight Lines Objectives:
Given value and sorted array, find index.
A Introduction to Computing II Lecture 13: Trees
Xuan Guo Lab 3 Xuan Guo
2.2: Graphing a linear equation
Red-black tree properties
Name the quadrant or the axis on which the following points lie.
CS203 Lecture 14.
Optimal Binary Search Tree. 1.Preface  OBST is one special kind of advanced tree.  It focus on how to reduce the cost of the search of the BST.  It.
Presentation transcript:

C241 PLTL SESSION – 2/22/2015 Graph Theory & Binary Search Trees

Warm-Up Exercise Grab a worksheet Begin completing the worksheet in pairs or small groups

Problem 1 Put the following sequence of numbers into a binary search tree data structure: 8, 7, 9, 5, 20, 12, 1, 4 What is the root of your tree? What is the depth of the resulting tree?

Problem 2 Consider the binary search tree data structure. What other sorts of data could it be useful for storing? Come up with three different situations in which you would use a binary search tree (BST) to represent your data.

Problem 3 Draw the following situation as a graph, (like the one from class today): In the domain of all people, everyone is mortal. Alex is nice and he trusts everyone, but no one trusts Alex. Ben and Chris trust each other, but only Ben is nice. Also, assume that everyone trusts themselves. (Note: In this context, “everyone” means Alex, Ben, and Chris. Also, think of the truth relation as a two-way street). T(x, y) = x trusts y M(x) = x is mortal N(x) = x is nice

Problem 4 Given the situation drawn above, translate the following into statements of predicate logic, and then assess the truth of each statement: A. Everyone is mortal. B. Everyone is mortal or nice. C. Everyone trusts someone. D. Everyone who is trustworthy is also nice. E. Someone trusts everyone. F. Everyone trusts someone nice, excluding themselves.