Question
Enter several integers, ending with 0. Count the number of occurrences of each different integer, and output different integers and the number of occurrences from
Enter several integers, ending with 0. Count the number of occurrences of each different integer, and output different integers and the number of occurrences from high to low. Input sample: 3 5 3 7 6 3 5 7 2 0 Output sample: 3:3 5:2 7:2 6:1 2:1
Requirements: 1. Use a single linked list (0 points if you use an array) 2, The linked list space must be deleted before the end of the program, do not cause memory leak (10 points) 3. Output from high to low according to the occurrence frequency of integer (25 points) 4. Can correctly count the number of different integers and their occurrence (35 points) 5. Ability to output linked list content (15 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started