C-5.8 Let a set of intervals S (lao,bol), a,bla-1,b- of the interval [0, 1] be given, with 0-ai ...
C-5.8 Let a set of intervals S (lao,bol), a,bla-1,b- of the interval [0, 1] be given, with 0-ai 〈 bi I, for i = 0, î, , n-1. Suppose further that we assign a height hi to each interval [ai, biļin S. The upper envelope of S is defined to be a list of pairs |(xo,co), (Xi,on), (x2.c2), , (xnnCm), (xm+ 1,0)), with xo- 0 andx1, and ordered by xi values, such that, for each subinterval s- [Xi, Xi+1] the height of the highest interval in S containing sis ci, for 1-0, î , . . . , m. Design an O(nlogn)-time algorithm for computing the upper envelope of S.
C-5.8 Let a set of intervals S (lao,bol), a,bla-1,b- of the interval [0, 1] be given, with 0-ai 〈 bi I, for i = 0, î, , n-1. Suppose further that we assign a height hi to each interval [ai, biļin S. The upper envelope of S is defined to be a list of pairs |(xo,co), (Xi,on), (x2.c2), , (xnnCm), (xm+ 1,0)), with xo- 0 andx1, and ordered by xi values, such that, for each subinterval s- [Xi, Xi+1] the height of the highest interval in S containing sis ci, for 1-0, î , . . . , m. Design an O(nlogn)-time algorithm for computing the upper envelope of S.