1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
riadik2000 [5.3K]
3 years ago
11

Write a function that takes in a pointer to the head of a linked list, a value to insert into thelist, val, and a location in th

e list in which to insert it, place, which is guaranteed to be greaterthan 1, and does the insertion. If place number of items aren’t in the list, just insert the item inthe back of the list. You are guaranteed that the linked list into which the inserted item is being
Computers and Technology
1 answer:
Reil [10]3 years ago
4 0

Answer:

Explanation:

6.....................................

void insertToPlace(struct node * &T,int val,int place)

{

struct node * q=T;

int count =1;

while(T->next!=NULL&&count<place-1)

{

T=T->next;

count++;

}

if(T->next==NULL)

{

struct node * p = (struct node *)new struct node;

p->data=val;

p->next=NULL;

T->next=p;

}

 

else

{

struct node * p = (struct node *)new struct node;

p->data=val;

p->next=T->next;

T->next=p;

}

T=q;

}

You might be interested in
Consider the following import statement in Python, where statsmodels module is called in order to use the proportions_ztest meth
den301095 [7]

Answer:

a. count of observations that meet a condition (counts), total number of observations (nobs), Hypothesized value of population proportion (value).

Explanation:

In other to use the proportion_ztest method, the need to make import from the statsmodel module ; statsmodels.stats.proportion.proportions_ztest ; this will allow use use the Z test for proportion and once this method is called it will require the following arguments (count, nobs, value=None, alternative='two-sided', prop_var=False)

Where;

nobs = number of observations

count = number of successes in the nobs trial or the number of successes for each independent sample.

Value = hypothesized value of the population proportion.

7 0
3 years ago
A. Write a program that asks the user to enter an integer, then prints a list of all positive integers that divide that number e
kobusy [5.1K]

Answer:

Following are the program in python language the name of the program is factors.py

num= int(input("Please enter a positive integer: "))#Read the number by user

print("The factors of ",num,"are:")

for k in range(2,num): #iterating over the loop

   if(num%k==0): #checking the condition

       print(k)#display the factor

Output:

Please enter a positive integer: 12

The factors of 12 are:

2

3

4

6      

Explanation:

Following are the description of the program

  • Read the number by user in the "num" variable
  • Iterating the for loop from k=2 to less then "num".
  • In the for loop checking the factor of "num"  variable by using % operator.
  • Finally display the factor by using print function
4 0
3 years ago
Can I have help on this
never [62]

the answer is the seconf one


6 0
3 years ago
Read 2 more answers
Can an engine run on air? I think it can, but I am not sure
Svetlanka [38]

Hello,

NO, and engine can run on steam, gas and other things but not air.

-Bella

3 0
3 years ago
Read 2 more answers
You are the administrator for the contoso.com website. recently, the server hosting the website had a failure that caused it to
Alisiya [41]
Protecting the Power supply
Adding disk Arrays
Install an NLB Cluster
4 0
3 years ago
Other questions:
  • The border that defines the outer boundary of a shape or other object
    13·1 answer
  • Jim wants to develop an app for a specific purpose that would run even when his computer is not connected to the Internet. What
    11·1 answer
  • Given the commands below, what do they do? for (position = 1 through aList.getLength()/2) { a = aList.getEntry(aList.getLength()
    11·1 answer
  • How to change screen resolution in windows 10?
    5·1 answer
  • How does emotional awareness help you with non-verbal communication?
    13·2 answers
  • To prepare a data character for transmission, a ____ bit is added to the beginning of the character and informs the receiver tha
    11·1 answer
  • Which term describes a visual object such as a picture, a table, or a text box?
    14·2 answers
  • What do you mean by HDML coding ​
    13·1 answer
  • Discussion Topic
    11·1 answer
  • Write a recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression based o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!