Program to print out the values and their counts

Assignment Help C/C++ Programming
Reference no: EM13936730

We have a list of numbers and we need to know two things, what numbers we have and how many of each number do we have in the list.

So we read in each number and add the number to an ordered linked list. If we are adding a number to the list and we find that number, then we will just count it. If we do not find the number in the linked list, then we will add a new node to the linked list with the new number and set the count to one.

The linked list node will have three fields - the number, a counter for the number and a link field.

Write a C++ program to achieve what we want, and print out the values and their counts, say 5 per line.

Example:

5(22) 8(15) 13(5) 22(3) 25(18)
where 5 is the number and 22 is its count.

Please use the attached input file "LinkNbrs.dat" for testing the program.

Attachment:- LinkNbrs.zip

Reference no: EM13936730

Questions Cloud

Program that computes and prints the 1000th prime number : You will need some variables to keep track of which prime number you're on and keep track of where you are in your loop.
What is the difference between genotype and phenotype : What is the difference between genotype and phenotype? What is the difference between haploid and diploids? What is the difference between a null mutation and a conditional mutation?
Advise flower angels : Nobody at Flower Angels read the fax until the Friday afternoon after the roses had been delivered to the customer's address. The customer is now refusing to accept the roses or to pay for it. Advise Flower Angels.
Describe key elements that you would include in scorecard : Is Snyder's strategy one of product differentiation or cost leadership? Explain briefly. Describe briefly key elements that you would include in Snyder's balanced scorecard and your reasons for doing so.
Program to print out the values and their counts : So we read in each number and add the number to an ordered linked list. If we are adding a number to the list and we find that number, then we will just count it. If we do not find the number in the linked list, then we will add a new node to the ..
How the use of solar power could solve the problem : Write paragraph about how lack of oil after few years in Saudi Arabia could affect in the community and how the use of solar power could solve the problem
What is the purpose of miranda warnings : What is the purpose of Miranda warnings? Why are Miranda warnings especially important to law enforcement officers in domestic violence cases? Is the Miranda warning still needed today, or should it be eliminated
Chemical fragments in ligand-protein interactions : Examining Halogen containing chemical fragments in ligand-protein interactions. The goal of my paper is to find preferable fragments containing halogen, F, Cl, Br, and I that interact with protein side chains in the protein binding sites.
Advantages and disadvantages of using iso standards : Discussion Questions from the book "A Guide to Computer Forensics and Investigations" 3rd Edition

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd