0% found this document useful (0 votes)
29 views3 pages

Spring 2024 - CS502 - 1

The document provides instructions for an assignment on finding maximal points in a 2D plane using a plane sweep algorithm. Students are given a set of 2D points and the pseudo code for the plane sweep algorithm. They must apply the algorithm to find the maximal points, showing the stack status at each step and the final set of maximal points.

Uploaded by

Shehroz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Spring 2024 - CS502 - 1

The document provides instructions for an assignment on finding maximal points in a 2D plane using a plane sweep algorithm. Students are given a set of 2D points and the pseudo code for the plane sweep algorithm. They must apply the algorithm to find the maximal points, showing the stack status at each step and the final set of maximal points.

Uploaded by

Shehroz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment No.

01
Spring 2024 Total Marks: 20
CS502- Fundamentals of Algorithms

Due Date: 29-04-2024

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:
 The assignment is submitted after due date.
 The submitted assignment is other than MS Word file.
 The submitted assignment does NOT open or file is corrupted.
 The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

 For clarity and simplicity, you are required to upload/submit only one .doc/docx file.

Lectures:

 Lectures 1 to 10 are covered in this assignment.

Objectives

 The objectives of this assignment are;

 To be able to understand concept of maximal point calculation in an efficient way by using plane sweep
algorithm.
 To be able to understand the concept of plane sweep Algorithm and its working.

For any query about the assignment, contact at CS502@vu.edu.pk

Good Luck!
Question No. 1 Marks: 20

The following is a set of 2-dimension space points. Each point has its x and y coordinate.:
P= {(2,11), (3,4), (5,9), (5,3),(6,8),(9,6),(12,4),(13,10),(14,8),(15,6)}
and the plane sweep algorithm pseudo code.
PLANE-SWEEP-MAXIMA(n, P[1..n])
 sort P in increasing order by x;

 stack s;

 for i ← 1 to n

 do

 while (s.notEmpty() & s.top().y ≤ P[i].y)

 do s.pop();

 s.push(P[i]);

 output the contents of stack.

You have to find out the final maximal set of points from given set of 2-dimension space point P = {p1, p2,p3,p4,p5,
…………… ,pn} using plane sweep algorithm and store it in a stack in sorted order by sweeping a vertical line from
left to right on x axis. The starting status of sweep line and stack is provided in the image. You have to follow it
and show the updated stack status in each step and the final image of the maximal set of points with stack
from left to right in the graph as well.

Note: In a given set of n points, P = {p1, p2, . . ., pn}, In 2-dimensional space a point is said to be maximal if it is
not dominated by any other point in P. The problem is to output all the maximal points of P.
Total Marks: 20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy