Give an algorithm for reversing a queue Q. Only following standard operations are allowed on queue. 1. enqueue(x) : Add an item x to rear of queue. 2. dequeue() : Remove an item from front of queue. 3. empty() : Checks if a queue is empty or not.. (Hint: you can use LinkedList, Stacks, and Queues from the java data collection)
OUTPUT Examples: Input : Q = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] Output :Q = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10] Input :[1, 2, 3, 4, 5] Output :[5, 4, 3, 2, 1]
In: Computer Science
|
YEAR |
Returns of the Stock 1
R |
Variances σ2 |
YEAR |
Returns of the Stock 2
R |
Variances σ2 |
|
1 |
6.31% |
1 |
12.25% |
||
|
2 |
5.98% |
2 |
12.98% |
||
|
3 |
5.74% |
3 |
12.86% |
||
|
4 |
5.12% |
4 |
9.76% |
||
|
5 |
4.76% |
5 |
-3.21% |
||
|
6 |
4.01% |
6 |
4.01% |
||
|
7 |
-2.57% |
7 |
4.21% |
||
|
8 |
3.50% |
8 |
5.98% |
||
|
SUM |
SUM |
||||
|
AVERAGE |
AVERAGE |
In: Finance
|
YEAR |
Returns of the Stock 1
R |
Variances σ2 |
YEAR |
Returns of the Stock 2
R |
Variances σ2 |
|
1 |
6.31% |
1 |
12.25% |
||
|
2 |
5.98% |
2 |
12.98% |
||
|
3 |
5.74% |
3 |
12.86% |
||
|
4 |
5.12% |
4 |
9.76% |
||
|
5 |
4.76% |
5 |
-3.21% |
||
|
6 |
4.01% |
6 |
4.01% |
||
|
7 |
-2.57% |
7 |
4.21% |
||
|
8 |
3.50% |
8 |
5.98% |
||
|
SUM |
SUM |
||||
|
AVERAGE |
AVERAGE |
In: Finance
We would like to invest the amount of 1 000 000 USD for 4 years. There we have zero-coupon bonds with the maturity of 1, 2, 3, 4…and 7 years with a uniform yield of 8 %. On this basis, we create 4 portfolios A, B, C, D such as:
|
Portfolio |
Maturity |
FV (USD) |
|
A |
4 |
1 360 489 |
|
B |
3 |
629 856 |
|
5 |
734 664 |
|
|
C |
2 |
583 200 |
|
6 |
793 437 |
|
|
D |
1 |
540 000 |
|
7 |
856 912 |
In: Finance
Each of the four independent situations below describes a
sales-type lease in which annual lease payments of $15,500 are
payable at the beginning of each year. Each is a finance lease for
the lessee. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1
and PVAD of $1) (Use appropriate factor(s) from the tables
provided.)
| Situation | |||||||||||||
| 1 | 2 | 3 | 4 | ||||||||||
| Lease term (years) | 3 | 3 | 3 | 3 | |||||||||
| Asset’s useful life (years) | 3 | 4 | 4 | 6 | |||||||||
| Lessor’s implicit rate (known by lessee) | 10 | % | 10 | % | 10 | % | 10 | % | |||||
| Residual value: | |||||||||||||
| Guaranteed by lessee | 0 | $ | 6,200 | $ | 3,100 | 0 | |||||||
| Unguaranteed | 0 | 0 | $ | 3,100 | $ | 6,200 | |||||||
| Purchase option: | |||||||||||||
| After (years) | none | 2 | 3 | 3 | |||||||||
| Exercise price | n/a | $ | 8,100 | $ | 2,100 | $ | 4,100 | ||||||
| Reasonably certain? | n/a | no | no | yes | |||||||||
Determine the following amounts at the beginning of the lease:
(Round your final answers to nearest whole
dollar.)
In: Accounting
For each of the three independent situations below determine the amount of the annual lease payments. Each describes a capital lease in which annual lease payments are payable at the beginning of each year. Each lease agreement contains an option that permits the lessee to acquire the leased asset at an option price that is sufficiently lower than the expected fair value that the exercise of the option appears reasonably certain. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $1) (Use appropriate factor(s) from the tables provided.)
| Situation | |||||||||
| 1 | 2 | 3 | |||||||
| Lease term (years) | 4 | 12 | 3 | ||||||
| Lessor’s rate of return | 11 | % | 12 | % | 10 | % | |||
| Fair value of leased asset | $ | 80,000 | $ | 430,000 | $ | 195,000 | |||
| Lessor’s cost of leased asset | $ | 60,000 | $ | 430,000 | $ | 155,000 | |||
| Bargain purchase option: | |||||||||
| Option price | $ | 20,000 | $ | 60,000 | $ | 32,000 | |||
| Exercisable at end of year: | 4 | 4 | 2 | ||||||
| Determine the annual lease payments for each situation: |
In: Accounting
which of the following is true
a) if the market price >ATC , The firm incurs loss
b) if the market price >ATC , The firm makes profit
c) if the market price >ATC , The firm ihas zero ecomonic profit
d) if the market price >ATC , The firm must shut down
2) refer to the bellow what is the average cost of the 3 hours of labors
| hours of labor | total product | marginal product | |
| 0 | |||
| 1 | 220 | 220 | |
| 2 | 370 | ||
| 3 | 540 | 170 | |
| 4 | 650 | 100 | |
| 5 | 50 |
1)60
2)80
3)180
4)540
In: Economics
Which of the following statements are true? For any false statements, explain.
1. Nitric acid reacts with magnesium metal and copper metal.
2. Sulfuric acid and nitric acid react with cupric oxide.
3. Heating cupric hydroxide produces copper metal.
4. Copper metal reacts with magnesium ion. Mg 2+.
5. Cupric ion is blue and magnesium ion is white in aqueous solution.
6. Sulfuric acid reacts with magnesium metal and copper metal.
I got
1. False
2. False
3. True
4. True
5. True
6. False
In: Chemistry
Comparing Two Population Means with Known Standard Deviations
In this problem you do know the population standard deviation of these independent normally distributed populations
The mean for the first set ¯xx¯ 1 = 15.49 with a standard deviation of σσ 1 = 2.5 There sample size was 13.
The mean for the first set ¯xx¯ 2 = 15.796 with a standard deviation of σσ 2 = 1.4 There sample size was 18.
Find the test statistic z= Round to 4 places.
Find the P-value for a left tail test. Use the rounded version of z to 2 decimal places. Then round the P-value to 4 places.
In: Statistics and Probability
Write a C++ program that :
1. Allow the user to enter the size of the matrix such as N. N must be an integer that is >= 2 and < 11.
2. Create an vector of size N x N.
3. Call a function to do the following : Populate the vector with N2 distinct random numbers. Display the created array.
4. Call a function to determines whether the numbers in n x n vector satisfy the perfect matrix property. Look at the sample run for the exact output
5. Repeat steps 1 - 4 until the user terminates the program.
The program needs a main and 2 functions
In: Computer Science