Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Artificial Intelligence

Lab Report

By:
GC Mureed Ullah

BESE-22B

DEPARTMENT OF COMPUTER SOFTWARE ENGINEERING


Military College of Signals
National University of Sciences and Technology
www.mcs.nust.edu.pk
Question 1:
Complete the following table for the Binary tree.

Nodes at Nodes searched by Nodes searched by


each level DFS iterative DFS
1 1 1
2 +2 = 3 +3 = 4
4 +4 = 7 +7 = 11
8 +8 = 15 +15 = 26
16 +16 = 31 +31 = 57
32 +32 = 63 +63 = 120
64 +64 = 127 +127 = 247
128 +127 = 255 +255 = 502
256 +256 = 511 +511 = 1013

Question 2:
Complete the following table having branching factor

Nodes at Nodes searched by Nodes searched by


each level DFS iterative DFS
1 1 1
4 +4 = 5 +5 = 6
16 +16 = 21 +21 = 27
64 +64 = 85 +85 = 112
256 +256 = 341 +341 = 453
1024 +1024 = 1365 +1365 = 1818

Question 3:
Write down the time and space complexity of Iterative deepening search based on the above tables.

Table Of Time Complexity Space Complexity


Time Complexity = O(b^d) Space Complexity =O(d)

Question 1 O(2^9) = O(512) O(9)

Question 2 O(4^6) = O(4096) O(6)

You might also like