Question: What is Time Complexity of the below pseudo code: Function DFS (head): curr = head count = 0; while (curr != None && curr.visited ==
What is Time Complexity of the below pseudo code:
Function DFS (head): curr = head count = 0; while (curr != None && curr.visited == False): count++; if (curr.1Child != None && curr.lChild.visited == False): curr= curr. 1Child else if (curr.rChild != None && else curr.rChild.visited == False): curr= curr.rChild; print curr.value curr.visited = 1; curr = head; print "count is : ", count
Step by Step Solution
3.43 Rating (159 Votes )
There are 3 Steps involved in it
Explanation The time complexity of the provided pseudocode depends on the structure of the ... View full answer
Get step-by-step solutions from verified subject matter experts
