(10 pts) Given the values below, describe the contents of the set, E, of the graph G=(V,E), that represents the binary search tree (unbalanced) created by adding each value, one by one, from left to right. values: R, E, D, B, O, A, T
Anything doubtful or not understand just comment I will touch with you. Please thumsup for my effort thank you and all the best
(10 pts) Given the values below, describe the contents of the set, E, of the graph...
NOTE: PLEASE GIVE YOUR ANSWER IN DETAILED EXPLANATIONS AS MUCH AS POSSIBLE. AND PLEASE LEGIBLE STEPS, THANK YOU. QUESTION 1 - Given the numbers below, describe the contents of the set, E, of the graph G=(V,E), that represents the binary search tree (unbalanced) created by adding each element, one by one, from left to right. 77, 27, 89, 32, 93, 43, 46, 51, 63, 69 Your answer: QUESTION 2 - Given the numbers below, describe the contents of the set,...
1. (2 pts each) The graph of some unknown function f is given below. 10 6/ 8-64-2 624 10 12 Use the graph to estimate the following quantities: (0 f (9) (g) f(4) b) lim (a) lim (e) (d) lim ( 6) (e) lim f(x) (c) lim f(x) if g(x)f(x) 6) a value of r where f is continuous but not differentiable (k) a value of r where f"(x) 0 and f"(x)>0 (1) the location of a relative maximum value...
Question 23 Not yet graded /0 pts Given a Binary Search Tree that is populated with numerical data, write an algorithm that will determine the sum, average, least and greatest of the values maintained in the tree. Express your algorithm in Java-like pseudodode. You may use any of the operations supported by the Binary Search Tree implementation used for Programming Project #5. Your solution must be developed at the application level. Your Answer For the next two questions you must...
2. (10 pts) Recall Binary Search: Input: a list of n sorted integer values and a target value Output: True if target value exists in list and location of target value, false otherwise Method: Set left to 1 and right to n Set found to false Set targetindex to - 1 While found is false and left is less than or equal to right Set mid to midpoint between left and right If target = item at mid then set...
IN JAVA Given is a weighted undirected graph G = (V, E) with positive weights and a subset of its edges F E. ⊆ E. An F-containing spanning tree of G is a spanning tree that contains all edges from F (there might be other edges as well). Give an algorithm that finds the cost of the minimum-cost F-containing spanning tree of G and runs in time O(m log n) or O(n2). Input: The first line of the text file...
4. Draw a simple (non-directional) graph G based on the given sets V(G) and E(G). V(G) = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) E(G) = { <1-2>, <1-3>, <2-4>, <2-5>, <3-6>, <5-7>, <5-8>, <6-9>, <9-10>, <8-11>} What type of a graph is it? A. Binary tree B. Full binary tree C. Complete binary tree D. Perfect binary tree 5. Find the diameter of the graph G in problem 4.12 points) D(G) = 6. Write the...
Write pseudocode for a recursive algorithm for inserting a key into a binary search tree. The following is the definition assumed. right? Write a) pto) You hadt written codes for for a algonithm for inserting a key into a binary seareh tree. The public class BST E extends comparable V prot fected bstNodeE protected class bstNode E V E key V value; ,V> right); bstNode E vright bstNode (E key ngvalue , bstNode«E·V> left . bstNode«E publle void insert (E...
Let G=(V, E) be a connected graph with a weight w(e) associated with each edge e. Suppose G has n vertices and m edges. Let E’ be a given subset of the edges of E such that the edges of E’ do not form a cycle. (E’ is given as part of input.) Design an O(mlogn) time algorithm for finding a minimum spanning tree of G induced by E’. Prove that your algorithm indeed runs in O(mlogn) time. A minimum...
1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30, 40, 50, 20, 10 first in a BST and then in a min-heap. Draw the resulting BST on the left and the heap on the right. You may draw any valid BST or Heap that contain the provided values 2. (5 pts) In section 11.1, the book mentions that heaps are **complete** binary trees, what does that mean? Demonstrate by drawing an example of...
a. The INORDER traversal output of a binary tree is U,N,I,V,E,R,S,I,T,Y and the POSTORDER traversal output of the same tree is N,U,V,R,E,T,I,S,I,Y. Construct the tree and determine the output of the PREORDER traversal output. b. One main difference between a binary search tree (BST) and an AVL (Adelson-Velski and Landis) tree is that an AVL tree has a balance condition, that is, for every node in the AVL tree, the height of the left and right subtrees differ by at most 1....