subject

#include #include

typedef struct nod{
int info;
struct nod *next;
}node;

node* SortInsert(node *root, int item); //this function is complete
void simplePrint(node* root); //this function is complete
int countNodes (node* root); //to create this function
node* EvenCopy(node * root); //to create this function

int main()
{
node* head=NULL;
node* head2 = NULL;

node *t;
int ch, ele;
head = SortInsert(head, 4);
head = SortInsert(head,6);
head = SortInsert(head,3);
head = SortInsert(head,5);

printf("\nSimple print List 1: ");
simplePrint(head);

printf("\nCount Nodes %d", countNodes(head)); //modify the countNodes function to make it work

head2 = EvenCopy(head); //modify the EvenCopy function to make it work
printf("\nSimple print after EvenCopy: ");
simplePrint(head2); //This call should print 4, 6

return 0;

}

void simplePrint(node* root)
{
node* t=root;
while(t!=NULL)
{
printf("%d ",t->info);
t=t->next;
}
}

node* SortInsert(node* root, int item)
{
node *temp;
node *t;
temp= (node *) malloc(sizeof(node));
temp->info=item;
temp->next=NULL;
if (root==NULL || root->info >=item)
{
temp->next = root;
root = temp;
}
else
{
t = root;
while (t->next != NULL && t->next->info next;
temp->next = t->next;
t->next = temp;
}

return root;
}

THE FOLLOWING QUESTIONS ARE HERE:

int countNodes (node* root)
{
/*this function takes the head of a linked list and returns the number of nodes available in the linked list. You can use for loops or recursion */

}

node* EvenCopy(node * root)
{
/*this function takes the head of a linked list and copies all the even numbers to a new linked list and return the
head of the new linked list. Note that a number is considered as even if number%2 is 0.
Example: passing the head of a linked list containing 3, 4, 5, 6 would return another linked list containing 4, 6 */

}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Researchers measured the data speeds for a particular smartphone carrier at 50 airports. the highest speed measured was 78.1 mbps. the complete list of 50 data speeds has a mean of x overbarequals16.11 mbps and a standard deviation of sequals18.65 mbps. a. what is the difference between carrier's highest data speed and the mean of all 50 data speeds? b. how many standard deviations is that [the difference found in part (a)]? c. convert the carrier's highest data speed to a z score. d. if we consider data speeds that convert to z scores between minus2 and 2 to be neither significantly low nor significantly high, is the carrier's highest data speed significant? a. the difference is nothing mbps.
Answers: 3
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
You know the right answer?
#include #include

typedef struct nod{
int info;
struct nod *next;
}n...
Questions
question
Mathematics, 30.04.2021 01:00
question
Mathematics, 30.04.2021 01:00
question
Mathematics, 30.04.2021 01:00
Questions on the website: 13722363