1 Which XXX completes the Python BinarySearchTree class’s search()…

Question Answered step-by-step 1 Which XXX completes the Python BinarySearchTree class’s search()… 1Which XXX completes the Python BinarySearchTree class’s search() method?def search(self, desired_key):    current_node = self.root    while current_node is not None:        if current_node.key == desired_key:            return current_node        XXX:            current_node = current_node.left        else:            current_node = current_node.right    return None  Group of answer choiceselif desired_key == current_node.key elif desired_key != current_node.key elif desired_key < current_node.key elif desired_key > current_node.key 2For a heap node with an index of 3 and a parent index of 1, identify the child node indices. Group of answer choices1, 2 0, 1 5, 6 7, 8 3Which XXX would replace the missing statement in the given Python insert() method for the MaxHeap class?def insert(self, value):    self.heap_array.append(value)    XXX Group of answer choicesself.percolate_down(len(self.heap_array) – 1) self.percolate_down(0) self.percolate_up(len(self.heap_array) – 1) self.percolate_up(0) 4Which of the following is the size of an adjacency list graph representation? V refers to the number of vertices, E the number of edges. Group of answer choicesO(V + E) O(V – E) O(V * E) O(V * 2E) 5Before calling Python’s dijkstra_shortest_path() function, each vertex’s distance attribute must be set to _____. Group of answer choices-float(‘inf’) 0 float(‘inf’) float(‘nan’)  6 At the start of each while loop iteration, the dijkstra_shortest_path() Python function assigns current_vertex with the _____ distance from start_vertex. Group of answer choicesunvisited vertex with the minimum visited vertex with the minimum unvisited vertex with the maximum visited vertex with the maximum  Computer Science Engineering & Technology Python Programming CSIS 3550 Share QuestionEmailCopy link Comments (0)

Leave a Comment

Your email address will not be published. Required fields are marked *