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
Diano4ka-milaya [45]
4 years ago
9

Given the following sequence of names added to an ADT sorted list:nameListPtr->insertSorted("Tammie");nameListPtr->insertS

orted("Brenda");nameListPtr->insertSorted("Sarah");nameListPtr->insertSorted("Tom");nameListPtr->insertSorted("Carlos");What would be returned by the call nameListPtr-> getPosition("Tammie")a. 1b. 3c. 4d. 5
Computers and Technology
1 answer:
lesya692 [45]4 years ago
4 0

Answer:              

c. 4

Explanation:  

This will work as following:

Lets say first Tammie is inserted by this statement insertSorted("Tammie")

Next insertSorted("Brenda") statement adds Brenda on top of Tammie so the sequence is now

  1. Brenda  
  2. Tammie

Next insertSorted("Sarah"); statement inserts Sarah below Brenda and above Tammie so the sequence becomes:

  1. Brenda
  2. Sarah
  3. Tammie

Next insertSorted("Tom"); statement inserts Tom below Tammie so the sequence becomes:

  1. Brenda
  2. Sarah
  3. Tammie
  4. Tom

Lastly insertSorted("Carlos"); statement inserts Carlos above sarah and below brenda so the sequence becomes:

  1. Brenda
  2. Carlos
  3. Sarah
  4. Tammie
  5. Tom

Now the statement getPosition("Tammie") is called which returns the position value of Tammie. So as you can see above its position is 4th so output is 4.

You might be interested in
Does a triangle with sides of lengths 1.5 ft, 2.5 ft, and 2 ft form a right triangle? How do you know?
timama [110]

Answer:

Yes, the side lengths of 1.5, 2.5, and 2 ft form a right triangle.

Explanation:

Before we solve this problem, we need to know a couple of things.

In a right triangle, you have two legs and a diagonal line that goes from one leg to the other or from one side to the other. This line is called the hypotenuse. It is the longest side of a right triangle. This length can be calculated by using a special formula that is over a thousand years old.

The formula is called the Pythagorean Theorem.

The formula states that if you square one leg and the other leg and add it up. You get the side of hypotenuse which is squared as well.

Here it is in simple terms: a^{2} +b^{2} =c^{2}.

a and b are your two legs.

C is your hypotenuse.

In this case 1.5 and 2 are your legs and 2.5 is your hypotenuse since it is the longest side.

Before we calculate, there is a converse to the Pythagorean Theorem.

If a^{2} +b^{2} \neq c^{2}, then it is not a right triangle.

Lets make 1.5 for a

and 2 for b.

We know 2.5 is for c.

Here it is.

1.5^{2} +2^{2} =2.5^{2}. The / means it is a fraction.

1.5 squared is 9/4 and 2 squared is 4. Add 4 and 9/4 and you get 25/4 squared. Take the square root of 25/4 and you get 5/2.

5/2 is equal to 2.5, so the Pythagorean Theorem applies to this triangle. Therefore, these side lengths do form a right triangle.

Hope this helps!

3 0
4 years ago
The development of instant cameras is generally credited to Oskar Barnack, an
Natalija [7]

Answer: that is false

Explanation:

7 0
3 years ago
Read 2 more answers
Whats included in ms office 2013 professional?
MrMuchimi
Powerpoint, word document, and excel
3 0
3 years ago
What was the first car ever produced by Henry ford
Slav-nsk [51]

It was "The Henry Ford"

6 0
3 years ago
After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
masha68 [24]
B. New Entry

I hope this helps
8 0
3 years ago
Read 2 more answers
Other questions:
  • Rags or wipes are considered non-hazardous waste when they are
    15·2 answers
  • A _____ is a machine that changes information from one form into another.
    7·1 answer
  • ………………….. is the process of causing a system variable to conform to some desired value. Options Control feedback Design none of
    9·1 answer
  • Write the Python code to implement each step of the following algorithm. Your code should use descriptive variable names and per
    7·1 answer
  • What's the difference between intranet and extranet ​
    9·1 answer
  • Complete the do-while loop to output every number form 0 to countLimit using printVal. Assume the user will only input a positiv
    9·1 answer
  • Match each career to its various job roles. digital media coordinator digital media specialist photographer sound producer creat
    13·1 answer
  • Krya needs help deciding which colors she should use on her web page. What can she use to help her decide.
    11·1 answer
  • write code to print out all combinations of pairs of numbers 1 through m and 1 through n, separated by a comma
    10·1 answer
  • Additional metadata data is stored alongside the binary colour values for each pixel. Give two examples of metadata?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!