Questions
Can you please do this in C asap. Promise to leave a awesome rating! Thank you...

Can you please do this in C asap. Promise to leave a awesome rating! Thank you in advance. Question and template below

Instructions-

LINKED LIST

In C
'objects' => structs
(struct - collection of data, not methods)
Linked List

Collection of objects which are all connected to each other

Each Object 'points' to the next item in the list


Node (struct) ' O '
- data
- nextNode

Our linked list will store data(structs containing integers) in order from smallest to largest

Generate one node for each data point
each node will point to the next node in the list
each node data point will be less than (or equal to) the 'next' node that it points to
Truths:
nothing points to HEAD
each node points to node of equal or larger value
HEAD smallest data point
last largest data point
last points to NULL


HEAD

'O'
3
-> 'O'
5
-> 'O'
8
-> 'O'
9
-> NULL


& = ADDRESS
// * creates Pointer variable
struct node* nodePtr;
// * also dereferences Pointer
*nodePtr
// look familiar?
obj.field

// put it all together
(*nodePtr).field


// allocating memory

malloc( sizeof(struct node) )
free( ptr )

TEMPLATE for assignment-

#include

#include

struct node

{

// data field

int data;

// nextNode field

struct node* nextNode;

};

/*

struct node myNode;

printf("%d", myNode.data);

printf("%p", myNode.nextNode);

*/

// FUNCTION - allocate and create a new Node

// Precondition - data exists

// Postcondition - Node allocated, and ptr returned

struct node* createNode(int newData)

{

// must allocate memory for each node

// because each nodes lifetime is longer than this function

// *note must manually deallocate (free) each node when program is complete

// memory for these nodes

// must outlive this function call

// myObj() => malloc()

// ~myObj() => free()

struct node* np = malloc(sizeof(struct node));

// set the fields

(*np).data = newData;

(*np).nextNode = NULL;

// return the pointer to this new Node

return np;

}

// FUNCTION - insert new Node into our linked List

// New Node inserted ahead of larger nodes

// Precondition - ptr to list containing 0 or more nodes

// Postcondition - after insertion list is always sorted

struct node* insertNode(struct node* list, int data)

{

// defining our reference data

// new node to be inserted

struct node* np;

// previous node

struct node* prev = NULL;

// current beginning of LL

struct node* head = list;

// current node

struct node* lp = list;

// create a new Node

...

//check if this is our first node

if(...)

{

//start the list with this node since it's empty

...

...

//return new head pointer, since list was empty now head is np

return ...;

}

// MOVE TO WHILE LOOP

// while list pointer isn't at the end

while( ... )

{

// if our current node data is larger than the new node data

// insert into list before current node

if( ... )

{

// insert new node into list by settings it's next node to current node

...

// check if this is NOT the beginning of the list

if(...)

{

// it's not, so remember to set last node to point to new node

...

}

else

{

// it is! cool, set head to new node

...

}

// send back the beginning of the list

return ...;

}

// what's the case for this 'else'?

// ...

else

{

// current node was smaller than new node

// lets check if we're at the end yet

if( ... )

{

// add new node to end of the list

...

// head didn't change, but return it anyway because we're done here

return ...;

}

// move the loop along becaue we aren't at the end of the list yet

...

...

}

}

// list ended for some reason...

// probably shouldn't ever reach this code...

// if we inserted the new node into the list, we would have returned head already...

// hmm...

fprintf(stderr, "ERROR: WE DIDN'T INSERT OUR NEW NODE FOR SOME REASON...");

return head;

}

// FUNCTION - call free on every node in our list from back to front

// Precondition - ptr to list containing 0 or more nodes

// Postcondition - return 0 on all nodes mem freed

// FREE EACH POINTER FROM END OF LIST TO FRONT

int freeListMemory(struct node* list)

{

// COMPLETE THIS ENTIRE FUNCTION

// *hint hint*

// free()

//

//

//on success

return 0;

}

//

// COMPLETE

// DO NOT EDIT

//

int main()

{

// insert create 7 data points

int data1 = 6;

int data2 = 4;

int data3 = 3;

int data4 = 1;

int data5 = 5;

int data6 = 7;

int data7 = 2;

// create POINTER to front of list

struct node *ptrHead;

ptrHead = NULL;

// insert each data point into the list

ptrHead = insertNode(ptrHead, data1);

ptrHead = insertNode(ptrHead, data2);

ptrHead = insertNode(ptrHead, data3);

ptrHead = insertNode(ptrHead, data4);

ptrHead = insertNode(ptrHead, data5);

ptrHead = insertNode(ptrHead, data6);

ptrHead = insertNode(ptrHead, data7);


// create list pointer for our loop

struct node *lp = ptrHead;

// Here we ASSUME list is non-empty

while( lp != NULL)

{

// print out the data for this node

printf("%d\n", (*lp).data);

// set the list pointer to the next node in the list

lp = (*lp).nextNode;

}

// REMEMBER TO FREE ALL LIST POINTERS

// FREE EACH POINTER FROM END OF LIST TO FRONT (reverse order)

// CALL freeListMemory()

int freed = freeListMemory(ptrHead);

return freed;

}

In: Computer Science

Question 1 At the beginning of 1976 a relative migrated to Australia with $10,000 ‘spare cash’....

Question 1

At the beginning of 1976 a relative migrated to Australia with $10,000 ‘spare cash’. The money could have been used to buy a block of land or invested in an ‘at-call’ savings account that paid interest at 8% p.a. compounded half-yearly. At the end of 2018, the land was valued by a local real estate agent who was keen to list the property on behalf of his agency, at a price of approximately $400,000.

Required:

  1. Which of the alternative investments had the higher value at the end of 2018? Justify your response with appropriate calculations.

(Students should write no more than 50 words for this part of the question).

  1. i)Assuming the half-yearly compounding of interest, what was the rate of growth in the land value over the total period expressed as a nominal annual interest rate?

  1. What was the rate of growth in the land value over the total period expressed as an effective interest rate?

  1. What was the rate of growth in the ‘at-call’ savings account over the total period expressed as an effective interest rate?

  1. What investment in the savings account would have been necessary at the beginning

of 1976, to have the same value as the land was worth at the end of 2018? Briefly explain your response.

(Students should write no more than 50 words for this part of the question).

  1. Recognising both your finance skills and ‘common sense’, one of your friends has asked whether your calculations above allow you to determine which of the investments would have been ‘better’ to make at the beginning of 1976, given the outcomes discussed above at the end of 2018. Provide a well-reasoned, complete response to this question taking into consideration various financial and non-financial issues.

(Students should write no more than 100 words for this part of the question).

e. i)You have now been provided further information that the investment in the land required the owner to make continuous annual payments of council rates over the total period held. These amounts are determined in accordance with Table 1 below. Assuming the land was sold at the end of 2018 (but ignoring the expected sale value), what is the adjusted present value at the beginning of 1976 of all the cash outflows relating to the acquisition and continued ownership of the land?

Note:     For the purposes of this question assume the following:

  1. Rates are payable on the anniversary of each year of land ownership.
  1. The annual amount of the rates are determined in accordance with the following formula;

Initial Purchase Cost ($) x Factor (times) x Relevant Percentage (%)

  1. Rates are still payable for the 2018 year (for the full year).

Anniversary number

Factor

Relevant

of years land held

(times)

Percentage (%)

1 to 5 years

1.0

1.5

6 to 10 years

1.5

1.5

11 to 15 years

3.0

1.0

16 to 20 years

6.0

1.0

21 to 25 years

10.0

0.8

26 to 30 years

20.0

0.8

31 to 35 years

25.0

0.6

36 to 40 years

30.0

0.6

41 to 45 years

40.0

0.4

Table 1

  1. Taking into consideration the calculations from part e) i) of this question, what is the rate of growth in the land value over the total period expressed as an effective interest rate?

(Students should write no more than 50 words for this part of the question).

In: Finance

1. List the steps that a non-U.S company must follow to list its shares on a...

1. List the steps that a non-U.S company must follow to list its shares on a U.S. stock Market?

2. Describe the SEC's work plan for incorporating IFRS into the financial reporting system for U.S issuers?

3. List some of the milestones that must be achieved before the SEC will require adoption of IFRS?

In: Accounting

1.What is employment at will? List exemptions to employment at will. 2. List three federal acts...

1.What is employment at will? List exemptions to employment at will. 2. List three federal acts that are important to employment law in the United States and briefly describe the effect of each.

In: Economics

Acquisitions and Payment Cycles List the accounts which are significant in acquisitions and payment cycles. List...

Acquisitions and Payment Cycles

List the accounts which are significant in acquisitions and payment cycles.

List why these accounts are considered significant and how they are involved in the acquisition and payment cycle.

In: Accounting

List two types of costing systems, and list three types of companies that use one or...

List two types of costing systems, and list three types of companies that use one or the other of the methods.

In: Accounting

Can you list the 'determinants of elasticity' so we have a generalized list of things that...

Can you list the 'determinants of elasticity' so we have a generalized list of things that would determine the elasticity of any product?

In: Economics

Can you list the 'determinants of elasticity' so we have a generalized list of things that...

Can you list the 'determinants of elasticity' so we have a generalized list of things that would determine the elasticity of any product?

In: Economics

list four delivery functions of the blood (list four things carried through the body by the...

list four delivery functions of the blood (list four things carried through the body by the blood

In: Biology

list ten things that are important to remember when creating a professional email. List the items...

list ten things that are important to remember when creating a professional email. List the items and briefly write one complete sentence about each one: why it is important to do, or not do, the item mentioned. Please edit your work. You will receive two points for each item.

In: Economics