[Solved] CSE222-505-Data Structures And Algorithms Homework 8

$25

File Name: CSE222-505-Data_Structures_And_Algorithms_Homework_8.zip
File Size: 489.84 KB

SKU: [Solved] CSE222-505-Data Structures And Algorithms Homework 8 Category: Tag:
5/5 - (1 vote)

Important Notes:1. In your homework, you should explicitly define a graph ADT and use the graph object for alloperations.2. You can use adjacency matrix, adjacency list or any other method to implement your graph.3. You are not allowed to use java.util.Collections in any level of the implementation. If youneed to use a data structure, you should implement it.

DescriptionWe have a group of people in which an ordered popularity relation is defined between personpairs. If there exist a relation such that (P1,P2) this means that A thinks that B is popular. The relationis transitive which means that if the relations (P1,P2) and (P2,P3) exist, than (P1,P3) also existevent if it is not specified by the input pairs. You are supposed to write a Java program whichfinds the people who are considered popular by every other person.Input (input.txt)* Line 1: Two space-separated integers, N (number of people) and M (number of ordered relations)* Lines 2..1+M: Two space-separated numbers P1 and P2, meaning that P1 thinks P2 is popular.Output* Line 1: An integer which represents the number of people who are considered popular by everyother person.Sample Input3 31 22 12 3Sample Output

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSE222-505-Data Structures And Algorithms Homework 8
$25