Menu

[solved]-Use Code Typedef Struct Node Int Data Struct Node Next Nodet Typedef Struct Nodet Head Nod Q39059684

Use the code:

typedef struct _node {
   int data;
   struct _node * next;
} node_t;

typedef struct {
   node_t * head;
   node_t * tail;
} LL_t;

Solve the following problems in C code.

Suppose we have the following input list L: head: NULL tail: a) Complete the function spliceinto (L, x, i) which inserts the

spliceinto(LL_t* var, int x, int i)

c) Complete the function removeNumber (L, target) which removes (all instances of the target from Lif target is found in L an

Make sure the code works first. Thanks

Suppose we have the following input list L: head: NULL tail: a) Complete the function spliceinto (L, x, i) which inserts the integer x into index location i of list L. If location i >= length of list L, then it appends node containing x at the end. For example: c) Complete the function removeNumber (L, target) which removes (all instances of the target from Lif target is found in L and does nothing otherwise. If successfully removed, return 0. Otherwise, return 1. // Post: removes data target from list L unsigned int removeNumber (LL_t * L, int target) { d) Complete the function numberOfEvens (L) which counts the number of even numbers in L and returns that number. In our list, the answer would be 5. // Post: returns the number of even numbers from list L unsigned int numberOfEvens (LL_t * L) { Show transcribed image text Suppose we have the following input list L: head: NULL tail: a) Complete the function spliceinto (L, x, i) which inserts the integer x into index location i of list L. If location i >= length of list L, then it appends node containing x at the end. For example:
c) Complete the function removeNumber (L, target) which removes (all instances of the target from Lif target is found in L and does nothing otherwise. If successfully removed, return 0. Otherwise, return 1. // Post: removes data target from list L unsigned int removeNumber (LL_t * L, int target) { d) Complete the function numberOfEvens (L) which counts the number of even numbers in L and returns that number. In our list, the answer would be 5. // Post: returns the number of even numbers from list L unsigned int numberOfEvens (LL_t * L) {

Expert Answer


Answer to Use the code: typedef struct _node { int data; struct _node * next; } node_t; typedef struct { node_t * head; node_t * t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *