Data Structure Lect12
Data Structure Lect12
Lecture 12
Topics
Recursive Algorithm
Factorial Example
Recursive Function
Example
Trees
Recursive Algorithm
3 x2 x 1= 6
You can write like that n(n-1)
Recursive Algorithm for n!
RECURSIVE STEP: Give a rule for finding its value at an integer from its values at smaller
integers.
BASIS STEP: There is a full binary tree consisting only of a single vertex r.
RECURSIVE STEP: If T1 and T2 are disjoint full binary trees, there is a full binary tree,
denoted by T1 · T2, consisting of a root r together with edges connecting the root to
each of the roots of the left subtree T1 and the right subtree T2.
Full Binary Tree