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
Difference between second and third generation of computer<br>​
Reil [10]

Answer:

one is less advanced and 3rd is more advanced and sometimes has fixed bugs and/or more features

Explanation:

8 0
3 years ago
Match the limits of the user with an appropriate design response. 1. severe arthritis, unable to type or use a mouse on a reliab
ololo11 [35]
Idk........................
4 0
3 years ago
You need to write th java syntax for the expression “7 is greater than or equal to 3” choose the best answer
shtirl [24]
If(7>=3)
{
.
.
.
}
Mark as brainliest
8 0
4 years ago
Anyone knows how to do this??
a_sh-v [17]
I dont know how to do that
4 0
3 years ago
If the ____________ is broken on a laptop, chances are other parts are also broken.
lana66690 [7]

Answer:keyboard

Explanation:

5 0
3 years ago
Other questions:
  • How many bits are in 1 tb? [hint: depending on the tool used to calculate this, you may need to use a trick to get the exact res
    6·1 answer
  • The file extension for Access 2007 and 2010 database filenames is .accdb. What is the file extension for older versions of Acces
    5·1 answer
  • Which network protocol is used to route IP addresses?<br>A. TCP<br>B. UDP<br>C. IP<br>D. ICMP
    15·1 answer
  • Types of relationships include aggregation, composition, link, generalization, and specialization 9. TRUE FALSE
    9·1 answer
  • If you change the text to bold,you are changing the what?
    9·1 answer
  • Does anyone know how to connect a nintendo switch to a laptop?
    10·2 answers
  • If an engineer wants to verify changes that she has been making on a router, which commands will allow her to check the routers
    15·1 answer
  • Which type of project data would you review for an accurate picture of the project progress and labor costs
    8·1 answer
  • Peer collaboration helps develop critical-thinking skills, which is the ability to
    9·2 answers
  • Would you rather be rich and unknown or famous and poor
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!