• Tidak ada hasil yang ditemukan

Also find the length of the MST

N/A
N/A
Protected

Academic year: 2023

Membagikan "Also find the length of the MST"

Copied!
1
0
0

Teks penuh

(1)

CSC306 Final Exam Autumn’14

1. (10+5)

 The diagram below is a weighted graph showing seven computer terminals a,b… g with the figure representing the distance in meters between the various computers. A LAN (Local Area Network) with the minimum length of cabling needs to be set up.

Using Prim’s Algorithm, find the minimal spanning tree, starting from node D, clearly displaying the implementation of the algorithm. Also find the length of the MST.

 Suppose that a graph G has a minimum spanning tree already computed. How quickly can the minimum spanning be updated if a new vertex and incident edges are added to G?

2. Write an algorithm to check whether a given graph G is connected or not. Assume the graph is given in the form of an adjacency matrix. (10)

3. Prove that (5+5)

 The largest and second largest number from n numbers can be found in no more than n+ |lg(n)| -2 comparisons.

 The largest and the smallest number from n numbers can be found in no more than | (3n-4)/2 | comparisons.

4. Prove or Disprove: (5+5) a) 2lgn = Ѳ (n).

b) lg n! = Ѳ (nlgn)

Referensi

Dokumen terkait

2.1 Concept of Triples A common way of representing relationships in a Knowledge Graph is in the form of Triples Subject, Predicate, Object where Subject comes from the domain,

Representing signed numbers using 2’s complement form • If the number is positive, the magnitude is represented p in its positional-weighted p g binary form, and a sign bit of 0 is