Koofers

Lecture Notes for CS 240 - Data Structures & Algorithms with Sengupta at SUNY Institute of Technology at Utica-Rome (SUNY IT)

Notes Information

Material Type:Note
Professor:Sengupta
Class:CS 240 - Data Structures & Algorithms
Subject:Computer Information Science
University:SUNY Institute of Technology at Utica-Rome
Term:Fall 2006
Keywords:
  • Inorder Traversal
  • On the Right
  • On the Left
  • Circumstances
  • Total Number
  • Specification
  • Binary Search
  • Constraints
Login / Sign Up to View Document
Preview Page 1Preview Page 2Preview Page 3Preview Page 4Preview Page 5Preview Page 6

Sample Document Text

Binary Tree. A binary tree is either an empty tree or a tree comprising a root node, left subtree and a right subtree. This is an empty binary tree at right. Some more binary trees: Single node binary tree. Two-node binary trees. Seven-node binary tree. Every binary tree can have at most two subtrees: left and right. The notion of parent, children, grandparent, grand-children. Basically, parent Left Child Right child Child A tree, if it’s not empty, begins at a root which is at level 0. The children of the root are at level 1, and their children are at the next level, and so on. The height of a tree is the maximum level that any of its node attains. Also, recursively, height(tree) = 1 + max (height(tree.left), height(tree.right)) A complete binary tree is one where every node except those at the deepest layer (level) has precisely two children. Let n(h) = total number of nodes in a complete binary tree of height h. Then, n ( 0) = 1 n(h) = 1 + 2n(h − 1) This shows that n( h) = 1 + 21 + 2 2 + 2 3 +...

Related Documents

On the Right Notes
On the Right Notes
On the Left Notes
On the Left Notes
On the Right Notes
On the Left Notes
Binary Search Notes
On the Left Notes
On the Left Notes
Binary Search Notes
On the Right Notes
On the Right Notes
On the Left Notes
On the Left Notes
On the Left Notes
On the Left Notes
155, "/var/app/current/tmp/"