13. Suppose you want to travel to different cities at the end of the year. You start to plan to visit Tai (denote as T),
Posted: Mon May 09, 2022 6:08 am
13. Suppose you want to travel to different cities at the end of the year. You start to plan to visit Tai (denote as T), Hua (denote as H). Yi (denote as Y). Kao (denote as K Nan (denote as N) and Peng desate as P). Due to limited budget, you find the cheapest fare to travel all the cities. You list down all the traveling fares between any two cities and draw a simple graph (shown as following graph). Now, you are required to apply Minimum Spanning Troe concept to find the total minimum fares and show all the routes between cities. Assume that the starting city is Tai and you must show the route between cities according to sequence you find the cheapest fare between cities (9 marks) DATA STRUCTURE AND ALGORITHM 120 11 30 60 70 70 50 70 40 90 80 14. a) Why the base case is important in recursive method? 3 marks) b) Design a recursive method testint n) to display the series data 0246... 0634 1-2 n when user passed the number n into method For example, when the ser passes the number 6 into recursive method, the method will display 0246. (6 marks) 15. Evaluate the worst case running time of the following pseudocode function and recurrence function in Big-O notation in terms of the variable. You must justify your answers a) T(m) 2(8) b) public void testo for (int i=nni>0; i--) 1 for (int j -0.jj++) System.out.println(" + for (int k = 0;kik++) System.out.println("+kX for (int -0,h<99999999,-) System.out.println( hh)