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
harkovskaia [24]
3 years ago
7

Frankie is considering whether to use a binary or linear search in her program to find a value in a sorted list. When she tests

the algorithms on selection of short lists of fixed-length lists she finds that the binary search is faster on average than the linear search. Another programmer suggests she tests both algorithms on a selection of lists which are 10 times as long as her original test lists. What most likely describes the likely results of this test?
Computers and Technology
1 answer:
muminat3 years ago
4 0

Answer:

binary search will still be faster

Explanation:

Based on this scenario, the most likely result is that the binary search will still be faster. This is because Binary search repeatedly cuts the list in half thus shortening the search times drastically. This being said, the longer lists will still take more than 10 times as long than the shorter lists because there is a far greater list of combinations for the search algorithm's to sort through.

You might be interested in
Write a method that accepts a String object as an argument and returns a copy of the string with the first character of each sen
emmainna [20.7K]

Answer:

The programming language is not stated; However, the program written in C++ is as follows: (See Attachment)

#include<iostream>

using namespace std;

string capt(string result)

{

result[0] = toupper(result[0]);

for(int i =0;i<result.length();i++){

 if(result[i]=='.' || result[i]=='?' ||result[i]=='!')  {

 if(result[i+1]==' ') {

  result[i+2] = toupper(result[i+2]);

 }

 if(result[i+2]==' ')  {

  result[i+3] = toupper(result[i+3]);

 }

 } }

return result;

}

int main(){

string sentence;

getline(cin,sentence);

cout<<capt(sentence);

return 0;

}

Explanation:

<em>The method to capitalize first letters of string starts here</em>

string capt(string result){

<em>This line capitalizes the first letter of the sentence</em>

result[0] = toupper(result[0]);

<em>This iteration iterates through each letter of the input sentence</em>

for(int i =0;i<result.length();i++){

This checks if the current character is a period (.), a question mark (?) or an exclamation mark (!)

if(result[i]=='.' || result[i]=='?' ||result[i]=='!')  {

 if(result[i+1]==' '){  ->This condition checks if the sentence is single spaced

  result[i+2] = toupper(result[i+2]);

-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized

 }

 if(result[i+2]==' '){ ->This condition checks if the sentence is double spaced

  result[i+3] = toupper(result[i+3]);

-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized

 }

}

}  <em>The iteration ends here</em>

return result;  ->The new string is returned here.

}

The main method starts here

int main(){

This declares a string variable named sentence

string sentence;

This gets the user input

getline(cin,sentence);

This passes the input string to the method defined above

cout<<capt(sentence);

return 0;

}

Download cpp
7 0
3 years ago
Advanced word processing programs come with a number of built-in images known as
Elena L [17]

The answer is Clip Art

Clip art is a collection of pictures or images that are either built-in or can be imported into a document. These pictures may either be vector graphics or raster graphics. Clip art gallery is typically organized into categories such as objects, people, nature, and many more. They can be anywhere between a few images to thousands of them.

4 0
3 years ago
Media _____ refers to a worldwide educational movement that aims to teach to people to understand how the media affect both indi
mario62 [17]

Answer:

literacy

Explanation:

Media literacy. This is a worldwide educational movement that aims to teach to people to understand how the media affect both individuals and society as a whole.

3 0
2 years ago
You can repeat a command in word by pressing the ____ function key.
valentinak56 [21]
You would repeat a command in word by pressing the F4 function key
4 0
2 years ago
Read 2 more answers
class bClass{public:void setX(int a);//Postcondition: x = a;void print() const;private:int x;};class dClass: public bClass{publi
MaRussiya [10]

Answer:

The answer to the given question in the option "a".

Explanation:

In the given c++ program the correct sets value of x and y is option a:

void dClass::setXY(int a, int b) //function implementation

{ //function body.

x = bClass.setX(a); //variable x hold value of setX() function.

b = y;  //variable b holds value of y.  

}

And other option are not correct that can be described as:

  • In option b, x is private variable of the base class that is inherit by the derived class but variable y is not part of the base class. that's why it is wrong.
  • In option c, x= a is correct but y=b is not correct. that's why it is wrong.
  • In option d we access the value of the private variable x that is a part of the base class but in this we not use any variable that holds its value. that's why it is wrong.

So the answer to this question is the option "a".  

6 0
3 years ago
Other questions:
  • True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
    11·2 answers
  • In Word, a red wavy underline indicates a/an
    15·1 answer
  • Suppose for the worst case, given input size n: Algorithm 1 performs f(n) = n2 + n/2 steps Algorithm 2 performs f(n) = 12n + 500
    6·1 answer
  • You want to configure two DHCP servers; one is running Windows Server 2012 R2, and the other is running Windows Server 2016. One
    9·1 answer
  • If a user's input string matches a known text message abbreviation, output the unabbreviated form, else output: Unknown. Support
    14·2 answers
  • Password is an example of an authentication mechanisms that is based on " what an entity has".
    6·2 answers
  • Which of the following relate to the term Technology?
    8·2 answers
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    13·1 answer
  • On line two, you take a string, word, as input. Then, using that string...
    9·1 answer
  • Formulas should follow the___
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!