In: Computer Science
Suppose that you have a program that can read through all posts within a given time period (e.g. the last 7 days) on a social network web site (e.g., Facebook), and generate a list of pairs (ui, pi) representing texts in all posts found, where i=1, 2, ..., and ui and pi represent the author username and the text content of the i-th post found, respectively. Describe an algorithm that outputs the list of usernames in the decreasing order of their total numbers of words posted among the posts described above. Analyze the running time of your algorithm. You may assume that the input of your algorithm is two arrays U and P that store the pairs (ui, pi) as defined above.
Please answer differently than solution already on chegg, I would like explanations to steps. Thank you.
Algorithm for above will be :-
1) Funtion which takes two input , one is the author array , and other is the posts array.
2)This functions returns the authors array , in the decreasing order of their words in the post.
3)The function will contain :-
This solution is according to me , and if you need any help , just comment , I will be happy to help.