0
Write a program to count repetation of name's of students in a classroom
There are n no. Of students in a classroom and all are said to stand in a straight line and they randomly arrange themselves in a straight line. You are allowed to ask their name in a sequence from student 1 to n and multiple students have the same name. Write an algorithm to print the name in the same order which they occur as u ask them. Also provide the complexity of your algorithm in Big o notation. Sample Input N=9 Alok, amit, suresh, amit, vidhya, sindhu, vidhya, vidhya, alok Output Alok-2 Amit-2 Suresh-1 Vidhya-3 Sindhu-1
3 Answers
+ 6
Ok first show us your attempt
if you get any errors then we can help
+ 1
Hint: use a dictionary with names as keys
0
Can any one please help me with the complexity in this
https://code.sololearn.com/cG7V2YegxsVR/?ref=app