Homework help – Write a program called MostCount that reads a text file called in.txt that contains a list of integers, duplicates are possible, separated by spaces. As you read the integers in the program should save them into a singly linked list in the same order they appear in the file. No modification of the list, before, during, or after reading, is allowed. This includes sorting, shuffling, or any other modifications of the nodes or elements. The nodes of the list should only have 2 pieces of information which are the reference to the next node and a data element to store the integer. No additional information may be stored by the list or the nodes.

The program should determine and print the count of the most frequent element in the list using only recursion. No looping structures such as while-loops or for-loops are allowed when determining this value. There may be more than one element with the same maximum frequency. We only want the count and not the element with the count.

———

Create a program called MostCount that reads a text file called in.txt that contains a list of integers separated by spaces, with duplicates allowed. The integers should be saved into a singly linked list in the same order they appear in the file as the program reads them. No changes to the list are permitted before, during, or after reading. This includes sorting, shuffling, and any other changes made to the nodes or elements. The list’s nodes should only have two pieces of information: a reference to the next node and a data element to store the integer. The list or the nodes may not store any additional information.

The program should compute and print the number of the most

Published by
Write
View all posts