


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
read it recursion ...
Typology: Lecture notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!
Faculty of Computer and Information Science Tutorial # 2 CS 411 : Algorithms Design and Analysis Recursion Tree
٤of١ Page
Steps:
Faculty of Computer and Information Science Tutorial # 2 CS 411 : Algorithms Design and Analysis Recursion Tree
٤of٢ Page
n
T(n/2) T( n/2) T(n/2 ) T( n/2 )
n
n/2 n/2 n/2 n/
T(n/4 ) T(n/4 ) T(n/4 ) T(n/4) - - - - -
n
n/2 n/2 n/2 n/
n/4 n/4 n/4 n/4 - - - - - - - - - -
T(n/8)-----------------------------------------
T(n) = 4T(n/2) +n
T(n/2)=4T(n/4)+n/
T(n/4) = 4T(n/8) +(n/4)
Faculty of Computer and Information Science Tutorial # 2 CS 411 : Algorithms Design and Analysis Recursion Tree
٤of٤ Page
〵⡹⡩
〶⢀⡨
from ᡗᡩᡳᡓᡲᡡᡧᡦ #
ᡆ䙦ᡦ䙧 = 4〹あ〴ㄘぁᡆ䙦1䙧 + 㔳 2〶
〵⡹⡩
〶⢀⡨
〵⡹⡩
〶⢀⡨
from ᡗᡩᡳᡓᡲᡡᡧᡦ #
ᡆ䙦ᡦ䙧 = ᡦ⡰ᡆ䙦1䙧 + ᡦ 㔳 2〶
〵⡹⡩
〶⢀⡨ ᡆ䙦ᡦ䙧 = ᡦ⡰ᡆ䙦1䙧 + ᡦ 䙰1 + 2 + 2⡰^ + ⋯.. +2〵⡹⡩䙱 ᠵᡦᡕᡰᡗᡓᡱᡡᡦᡙ ᠳᡗᡧᡥᡗᡲᡰᡡᡕ ᡅᡗᡰᡡᡗᡱ ᡰ = 2 ᡓ = 1