Given a set S of dabs, find an algorithm that returns a dab of maximumcardinality containing only segments from the dabs in S. The algorithm shouldrun in O(n2) time, where n is the total number of segments of all dabs containedin S.
(i) Clearly describe and explain your algorithm.
(ii) Describe your algorithm in a few lines of pseudocode.
(iii) Prove that your algorithm is correct.
(iv) Derive the asymptotic running time of your algorithm.