Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 1.25 KB

File metadata and controls

12 lines (9 loc) · 1.25 KB

Data_structure_and_algorithms_Assignment4

Marvel Character Graphs This assignment is based on the no of co-occurrences of different marvel characters in different movies.

Average

Print the average number of characters each Marvel character is associated with, as a float upto two decimal places.

Rank

Print a sorted list of all characters, with comma as delimiter (only comma, as delimiter and no space). Sorting should be in descending order of co-occurrence with other characters. That is, characters with more co-occurrences appear before. If there is a tie between characters based on co-occurrence count, then the order should be descending based on lexicographic order of the character strings.

independent_storylines_dfs

Implement DFS, then find independent storylines, that have no edge across them, using DFS. Print the characters in each independent storyline, as a separate line in the output. The largest storyline (with maximum characters) should appear at the top, followed by the second largest and so on. Within each line, the character names should be delimited with comma, and lexicographically sorted in descending order. If two storylines have same number of characters, ties should be broken in lexicographically descending order of character names