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
Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values
Alex73 [517]

Answer:

As per the question we need to make 5 rowa and 2o columns, in this we have total element 100 so range should be 0 to 99, but we are suggested to keep range 0 to 59, so i have kept the elementns in the range, but if it was a typo in the question for range you do not need to reset the k with zero.

Explanation:

//create a new class  TestArray

public class TestArray {

//define main method

public static void main(String[] args) {

 //declare a 2D array of given size i.e. 5 rows and 20 columns

 int arr[][] = new int[5][20];

 //declare an integer variable k and initialize it with zero, this will used to initialize the array from 0 to 99

 int k = 0;

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //initialize arr with the current value of k

   arr[i][j] = k;

   //once k is 59 set it zero again as we are not going beyond 59

   if(k == 59)

    k = 0;

   //increment value of k with 1

   k++;

  }

 }

 //print the element from the array one by one

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //print the current element of array and an space with it

   System.out.print(arr[i][j]+" ");

  }

  // move the cursor to new line

  System.out.println();

 }

}

}

7 0
4 years ago
The use of multiple _______ is sometimes called using a search phrase.
zysi [14]
Hello, thank you for your question.

The answer to your question, "<span>The use of multiple _______ is sometimes called using a search phrase.," would be:

Keywords</span>
4 0
3 years ago
Write a program to prompt the user for a positive integer: N. The program will repeatedly divide the input in half using a loop,
a_sh-v [17]

Answer:

using python to write the program

Explanation:

#To use the log function, the module must be imported

import math

n=int(input("Enter number to be halved"))

count=0

while(n>1):

   count=count+1

   n=n//2

print("The number halved is now ", n, "The is the ", count, "iteration")

x = math,log(2,(n))

print("The log of n is:", x)

5 0
3 years ago
Site three uses of powerpoint when it is used for educational purposes.​
CaHeK987 [17]
1. It can be used to create a slideshow for that class.
2. It can used as a place to keep and check grades.
3. It can be used for a place to keep all the students names and where they sit etc.
5 0
3 years ago
What are some areas in Computer Science that make use of multivariate statistical testing or MCM methods? Explain why they are u
Nikolay [14]

Explanation:

Computational modeling is one of the areas of Computer Science that uses mathematical systems to perform multivariate statistical tests to solve highly complex problems in multidisciplinary areas, such as medicine, engineering, science, etc.

An example of the use of multivariate statistical tests is social development research in social science, which uses multiple variables to find more hypotheses and greater coverage between variables.

Multivariate statistical tests have the benefit of making research more effective and providing a more systematic and real view of the study.

6 0
3 years ago
Other questions:
  • Laura is using studio lighting while photographing a model. The four elements that she will use in studio lighting are hot light
    10·1 answer
  • The intersection of a row and a column is commonly called what?
    15·1 answer
  • What is the term for a server at the highest level of the Domain Name System (DNS)?
    15·1 answer
  • What is the name of a button on a website?
    11·1 answer
  • Helllllllllppppppppppp
    9·1 answer
  • The given SQL creates a Movie table with an auto-incrementing ID column. Write a single INSERT statement immediately after the C
    12·1 answer
  • Please help with my Python code - Functions
    9·1 answer
  • Please define processor​
    14·1 answer
  • Question #4
    7·1 answer
  • Which tab contains the Spell Check feature?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!