Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least one non-negative integer.
Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.
Ex: When the input is:
15 20 0 3 -1the output is:
20 9.50Task:
Your task is to make 2 circular queues using static array of same size. User should be allowed to input values at the back of the queue. And when an element in removed from the first queue by moving front pointer it should be instered into the second circular queue and you should keep checking both the circular queues if they are full or have they been emptied.
A company is planning to provide an extra discount to it's customers. Every order has an order ID associated with it which is a sequence of digits. The discount is calculated as the count of unique repeating digits in the order ID. Write a code to find the discount percentile given to the customers.
A company is planning to provide an extra discount to it's customers. Every order has an order ID associated with it which is a sequence of digits. The discount is calculated as the count of unique repeating digits in the order ID. Write a code to find the discount percentile given to the customers.
A company is planning to provide an extra discount to it's customers. Every order has an order ID associated with it which is a sequence of digits. The discount is calculated as the count of unique repeating digits in the order ID. Write a code to find the discount percentile given to the customers.
I have tried to do the question but it got tricky for me to complete it.
the question is on the following link
https://drive.google.com/file/d/17kEiEoJFVYfc2zLqDdPskPKBD_MTjpKu/view?usp=sharing
what I have done so far is on the following link:
https://drive.google.com/file/d/1N_Y0Fqr0zEbvd0JrYWs1JJWmz_k4bAZC/view?usp=sharing
please assist
Recall that a full binary tree is a binary tree where each level of the tree has the maximum
number of nodes possible.
a. If the level of the root of a non-empty full binary tree is level 1, the level of the root's
children is level 2, etc., how many nodes are on level i, i ≥ 1?
b. If a non-empty full binary tree has n levels (or a height of n), how many nodes does the
tree have in total? Express your answer in closed form (i.e. do not use "..." in your final
answer).
c. Prove that the number of leaves in a non-empty full binary tree is 1 more than the number
of non-leaves. When you prove this, don't just show an example. Write your proof in
general for ANY non-empty full binary tree.
Consider the two different techniques we used for implementing traversals of a binary
tree. Why must we check before the call to preorder when implementing as a method,
whereas we could check inside the call when implementing as a function?
You wish to create a database of stars. For each star, the database will store several megabytes of data. Considering that your database will store billions of stars, choose the data structure that will provide the best performance. With this data structure you should be able to find, insert, and delete stars. Justify your choice.
A student spends a majority of his weekend playing and watching
sports, thereby tiring him out and leading him to oversleep and often
miss his Monday 8 AM math class. Suppose that the tuition per semes-
ter is $25,000 and the average semester consists of 15 units. If the math
class meets three days a week, one hour each day for 15 weeks, and is a
four-unit course, how much does each hour of math class cost the stu-
dent? Design an algorithm that computes the cost of each math class