Write a C program that demonstrate tree traversal.
A. first is to ask the user to enter data
B. ask how many nodes
THIS IS JUST A SAMPLE. PLEASE ANSWER IT IN COMPLETE CODE.
See for the sample output.
Sample Output:
How many node do you have in your tree : 5
Enter root: 20
if you want to add to the left press 0 otherwise press 1
answer: 0
Enter next node: 10
if you want to add to the left press 0 otherwise press 1
answer: 0
Enter next node: 8
if you want to add to the left press 0 otherwise press 1
answer: 0
Enter next node: 15
if you want to add to the left press 0 otherwise press 1
answer: 1
Enter next node: 21
Display tree
20
/ \
10 21
/
8
/
5
Preorder – 20, 10, 8, 5, 21
Inorder – 5, 8, 10, 20, 21
Postorder – 5, 8, 10, 21, 20
COMMENT CODE PLS....
In: Computer Science
The Fox Corporation is looking to replace an existing printing press with one of two newer models that are more efficient. The current press is three years old, cost 32,000 and is being depreciated under MACRS using a 5-year recovery period. The first alternative under consideration, Printing Press A, cost $40,000 to purchase and $8,000 to install. It has a 5 year usable life and will be depreciated under MACRS using a 5-year recovery period. The second alternative, press B cost $54,000 to purchase and $6,000 to install. It also has a 5 year usable life and will be depreciated under MACRS using a 5 year recovery period. The purchase of press A would result in a $4,000 increase in net working capital, and the purchase of Press B would increase net working capital by $6,000. The projected Earnings before depreciation interest and taxes for each alternative is presented below.
|
Year |
Press A |
Press B |
Existing press |
|
1 |
25,000 |
22,000 |
14,000 |
|
2 |
25,000 |
24,000 |
14,000 |
|
3 |
25,000 |
26,000 |
14,000 |
|
4 |
25,000 |
28,000 |
14,000 |
|
5 |
25,000 |
28,000 |
14,000 |
The existing press can currently be sold for $18,000 before taxes. At the end of the 5 years the existing press can be sold for $1,000 before taxes. Press A can be sold to net $12,000 before taxes and press B can be sold to net $20,000 before taxes at the end of the 5 year period. The firm is subject to a 40% tax rate.
The company has $100M of debt outstanding with a yield-to-maturity of 8%, and has $150M of equity outstanding with a beta of 0.9. The expected market return is 13% and the risk-free rate is 5%.
What is the 1) discounted payback period 2) NPV 3) IRR 4) MIRR
Please answer on an excel document explaining how you found each answer. Thank you
In: Finance
A healthy young boy has a systolic blood pressure of 130 mmHg and a Pulse pressure of 65 mmHg. This boy goes to the gym and starts to run on the treadmill. After the run, he has a diastolic blood pressure of 85 and a systolic blood pressure of 160. Please calculate the change of mean arterial pressure.
In: Anatomy and Physiology
Alternative-Fueled Vehicles The table shows the numbers (in thousands) of alternative-fueled
vehicles A in use in the United States from 1995 to 2011. (Source: U.S. Energy Information Administration)
|
Year |
Number of vehicles, A |
|
1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 |
246.9 265.0 280.2 295.0 322.3 394.7 425.5 471.1 534.0 565.5 592.1 634.6 695.8 775.7 826.3 938.6 1191.8 |
(a) Use a graphing utility to plot the data. Let t represent the year, with t = 5 corresponding to 1995. (b) A model for the data is
4615.36t − 8726.7
1 + 15.01t − 0.542t2, 5 ≤ t ≤ 21
where t = 5 corresponds to 1995. Use the model to estimate the numbers of alternative-fueled vehicles in 1996, 2006, and 2011. How do your answers compare to the original data?
(f ) Use the model to predict the numbers of alternative-fueled vehicles in 2016 and 2017
* Need help to understand F . Should I be using a particular formula
In: Advanced Math
Hook Industries is considering the replacement of one of its old drill presses. Three alternative replacement presses are under consideration. The relevant cash flows associated with each Press are shown in the following table. The firm’s cost of capital is 15%.
|
Press A |
Press B |
Press C |
|
|
Initial Investment (Y0) |
$85,000 |
$60,000 |
$130,000 |
|
Year |
Cash Inflows |
||
|
1 |
$18,000 |
$12,000 |
$50,000 |
|
2 |
$18,000 |
$14,000 |
$30,000 |
|
3 |
$18,000 |
$16,000 |
$20,000 |
|
4 |
$18,000 |
$18,000 |
$20,000 |
|
5 |
$18,000 |
$20,000 |
$20,000 |
|
6 |
$18,000 |
$25,000 |
$30,000 |
|
7 |
$18,000 |
--- |
$40,000 |
|
8 |
$18,000 |
--- |
$50,000 |
b. Using NPV, evaluate the acceptability of each press.
c. Rank the presses from best to worst using NPV.
d. Calculate the profitability index (PI) for each press.
e. Rank the presses from best to worst using PI.
In: Finance
2. (13 pts.) A factory is considering replacing its existing
coining press with a newer, more efficient one. The existing press
was purchased 4 years ago for $450,000 and is being depreciated
according to a 7-year MACRS depreciation schedule. (See page 4 for
the MACRS schedules.) The factory’s CFO estimates that the existing
press has 5 years of useful life remaining. The new press’s
purchase price is $560,000. Installation of the new press would
cost an additional $40,000; this installation cost would be added
to the depreciable base (i.e., it would be capitalized) and then
depreciated across time. The new press (if purchased) would be
depreciated using the 7-year MACRS schedule although the
factory
Assignment 3, p.2
(2, continued) will retire or sell the new press after 5 years.
Interest expenses associated with the purchase of the new press are
estimated to be roughly $8000 per year for the next 5 years. If the
new press is purchased, revenues will remain the same as they’d be
if the old press were maintained. However, the appeal of the new
press is that it will reduce production costs by $153,000/year for
the next 5 years. Also, if the new press is purchased, the old
press can be sold for $60,000 today. The CFO believes that the new
press would be sold for $90000 in 5 years; the old press’s value at
t=5 will be $0. NWC would not be affected. The company’s marginal
tax rate = 34.0%. The cost of capital (i.e., the required rate of
return) for this project is 7.5% (although this variable is not
needed in this problem, given the instructions below)
Calculate the incremental cash flows for this replacement decision, for time 0, for each year of operation, and at termination. Please make sure that you show clear work as to determine how you arrived at your incremental cash flows! [Hint: The old press’s net book val. at t=0 is $140,580. Hint: I want to remove any doubts surrounding the depreciation schedule for the old machine. Yes, if kept in place, the existing machine will reach a book value of $0 before the machine is retired. Many long-term assets are still functional after they’re fully depreciated.] [Note: Normally, you would then use these cash flows to calculate NPV and IRR of the incremental decision to either (1) buy the new press and sell the old one or (2) keep the old press. Next, you would make a conclusion about whether or not the existing coining press should be replaced at this time. However, this assignment already contains an adequate number of other NPV and IRR calculations.]
In: Finance
What are the major developments in Novel hybrid inorganic - organic polymer systems in the last 10 years?
In: Chemistry
3. How successfully does Ngugi employ point of view in his novel Weep not, Child.
In: Psychology
John Boy Lumber cuts logs to create 2 immediate joint products, lumber and sawdust. Unfinished lumber can be sold as is for $140 or processed further at a sales price of $270. Sawdust can be sold as is for $40 or processed further for a sales price of $50. There are joint product costs (costs up to the split off point) allocated to each of the products – $176 for lumber and $24 for sawdust. The cost of further processing is $40 for lumber and $20 for sawdust.
a. Should John Boy Lumber process lumber further or sell the unfinished lumber as is?
b. Should John Boy Lumber process the sawdust further or sell it as is?
In: Accounting
J.K. Toweling has decided to leave her job in order to write her first novel. She will finance this through her savings of $70,000 which are in a bank account that pays her 4.8% p.a. compounding monthly. At the end of each month, she will withdraw $3,000 from this account to cover her living expenses. If it is expected to take her 15 months to complete the novel, how much will she have left in her bank account just after that final withdrawal of $3,000?
In: Finance