subject

Write a c++ code based this question

n this assignment you will create three additional functions for each one of the data structures created in class. you will be provided with a header file which you will modify and a demo program for each data structure. if your functions are implemented correctly the demo programs should compile and execute correctly.

part 0 (comments)

1. over the course of the semester we have discussed comments for each data structure. add any comments you view as necessary to the header file before writing your own functions

part 1 (stack)

1. write a function which sorts the stack in order from the largest value to the smallest value. this should be a modified version of bubble sort.

2. write a function which prints the values in the stack in reverse order.

3. write a function which the counts the number of odd numbers and even numbers currently in the stack and prints the results.

optional

4. write a function which prints how many numbers in the stack are divisible by 2,3, and 5.

part 2 (queue)

1. write a function which sorts the queue in order from the smallest value to the largest value. this should be a modified version of bubble sort.

2. write a function which adds a value to the queue in the correct position (numbers are arranged from the smallest value to the largest value).

3. write a function which prints the median and mean of the queue. take some time to consider all the required conditions to calculate the median of a dataset.

optional

4. write a function which prints the mode of the queue. (the number which appears the most frequently in the queue)

part 3 (link list)

1. write a function which adds 4 to all the even values in the link list and multiples all the odd values by 5.

2. write a function which multiplies the values in odd position values by 10. odd positions in this case refers to the first value in the list, the third value, the fifth value etc.

3. write a function which determines if the values in the queue is divisible by 5 or 10 if true the value is divided by 5.

optional

4. write a function which prints all the prime values in the queue

part 4

1. trace each demo program by hand using the table from your midterm exam for stacks and queues.

notes- while writing these functions you should consider all the conditions which need to be checked by each function. the demo program will check these cases. when the word print is included in the question no changes are made to the values in the queue, stack, or link list; the required information is just displayed on the screen.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 23.06.2019 16:50
15: 28read the summary of "an indian's view of indian affairs."15 betterin "an indian's view of indian affairs," it is asserted that conflicts could be reduced if white americansunderstood native americans..pswhich of the following would make this summary more complete? eleo the fact that chief joseph believes the great spirit sees everythinthe fact that chief joseph was born in oregon and is thirty-eight years oldo the fact that chief joseph states that he speaks from the hearthehehethe fact that chief joseph of the nez percé tribe made this claimebell- ==feetle===-felsefe ==submitmark this and retum.=
Answers: 3
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
You know the right answer?
Write a c++ code based this question

n this assignment you will create three additional...
Questions
question
History, 05.11.2020 19:20
question
English, 05.11.2020 19:30
question
Geography, 05.11.2020 19:30
question
Mathematics, 05.11.2020 19:30
question
Mathematics, 05.11.2020 19:30
question
Mathematics, 05.11.2020 19:30
Questions on the website: 13722360