Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Algorithm Mergesort(L,n): //L is a list of n>=0 numbers. if n>=2 then { m:=[n/2]; L1:= List containing first m element of L; L2:= List containing

image text in transcribedimage text in transcribed

Algorithm Mergesort(L,n):

//L is a list of n>=0 numbers.

if n>=2

then {

m:=[n/2];

L1:= List containing first m element of L;

L2:= List containing the last n-m elements of L;

L1:= Mergesort(L1,m);

L2:= Mergesort(L2, n+m);

L:=Merge(l1, l2);

}

return L.

Algorithm Merge( L1, L2):

//L1 and L2 are two sorted lists

L:= EmptyList;

while L1!= emptyset and L2 != emptyset

do{

x:= first element of L1;

y:= First element of L2;

{

if x

append x to L;

else remove y from L2;

append y to L;

}

}

if L1 is non empty then append L1 to L;

if L2 is non empty then append L2 to L;

Return L;

Question 9: Let n 1 be an integer and cus der a set S consisting of n points in R. Each point p of S is given by its z- and -cooedinates p, and p., rpeetively. We esume that no two polnts of S have the same -coordinate and Bo two points of S have the same y-coondinate A polut p of S is called merimal in S of p Le. thene is no point in S that is to the narth-east The figure below shows an example, in which the points are maximal and the x-points are not maximal. Ohserve that, in general, there is more than oue maximal element in S. Question 9: Let n 1 be an integer and cus der a set S consisting of n points in R. Each point p of S is given by its z- and -cooedinates p, and p., rpeetively. We esume that no two polnts of S have the same -coordinate and Bo two points of S have the same y-coondinate A polut p of S is called merimal in S of p Le. thene is no point in S that is to the narth-east The figure below shows an example, in which the points are maximal and the x-points are not maximal. Ohserve that, in general, there is more than oue maximal element in S

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago