Search for question
Question

a) Write a function to generate and store the tree. Students can define a data structure with various attributes such as,Tree(1).ID, Tree(1).name, Tree(1).status, Tree(1).parent, Tree(1).children, Tree(1).cost,Tree(1).state

One method of entering the tree in the data structure is to store every node manually

b) For a tree, find the goal node by DFS and BFS and record the time and space complexity of the algorithms in a table and discuss the results.

Time complexity

Tic

%yourCode

timeElapsed = toc

Space complexity

Maximum length of the fringe variable during execution of the code.

Fig: 1