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
arlik [135]
2 years ago
15

What is the time complexity of the addElement operation?

Computers and Technology
1 answer:
GREYUIT [131]2 years ago
8 0

Answer:

The time complexity in the computer science is define as the computational complexity which basically describe the total amount of the time taken to execute the algorithm.

Time complexity is basically estimated by count the number of operation perform by the algorithm.

The time complexity of add-element operation is 2*log n or O(log n) and each time complexity is done by the log n times.

You might be interested in
A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Ab
Pavlova-9 [17]

Answer:

Following are the program in the C++ Programming Language.

//header file

#include <iostream>

//header file for string

#include <string>

#include<cstring>

//using namespace

using namespace std;

//define Function to checks the string is passed is a Palindrome or not

bool is_Palin(string strng, int start_Position, int end_Position)

{

//set the if Conditional statement

if(start_Position >= end_Position)

{

return true;

}

//Check if the character is not the alphabet

if(!isalpha(strng[start_Position]))

{

//Update the starting position  

start_Position += 1;

//call Recursive function

return is_Palin(strng, start_Position++, end_Position);

}

//Check if the character is not the alphabet

if(!isalpha(strng[end_Position]))

{

//Update the end position

end_Position -= 1;

//call Recursive function

return is_Palin(strng, start_Position, end_Position--);

}

//Check if the characters are same or not same

if(tolower(strng[start_Position]) != tolower(strng[end_Position]))

{

return false;

}

//Update the positions

start_Position = start_Position + 1;

end_Position = end_Position - 1;

//call Recursive function

return is_Palin(strng, start_Position, end_Position);

}

//define Main function

int main()

{

string strng;

//get string from the user

cout << "\n\n Enter a string: ";

getline(cin, strng);

//Check for the palindrome

if(is_Palin(strng, 0, strlen(strng.c_str())-1))

{

 //then print message

cout << "\n Is a Palindrome!!!! \n";

}

//otherwise

else

{

//then print message

cout << "\n Is not a Palindrome!!!! \n";

}

return 0;

}

<u>Output:</u>

Enter a string:  Able was I, ere I saw Elba

Is a Palindrome!!!!

Explanation:

Here, we define a boolean data type function "is_Palin" to check the string which passed through is palindrome or not and pass and pass two integer type arguments for starting position and ending position and pass one string data type argument to pass string, inside the function.

  • Set the if conditional statement to check the condition if the start_position of the string is greater than end _position of the string then return true.
  • Set the if conditional statement to check the condition the start_position of the staring is alphabet then, update the start_position and call the recursion function.
  • Again set the if conditional statement to check the condition the end_position of the staring is alphabet then, update the end_position and call the recursion function.
  • Set the if conditional statement to check the condition if the start_position of the string is not equal to the end _position of the string then, return false.
  • Then, update the start_position and end _position of the string increment by 1 then, call the recursive function and then, close the function.

Finally, we define the main function and pass string through calling and passing and argument list in its parameter.  

5 0
2 years ago
Write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and upda
Lady_Fox [76]

Answer:

Following are the statement is given below

if(updateDirection ==1) // check condition

{

++numUsers; // increments the value

}

else

{

--numUsers; // decrement the value

}

Explanation:

Following are the description of statement

  • Check the condition in the if block .If the "updateDirection" variable is 1 then then control moves to the if block otherwise control moves to the else block statement.
  • In the if  block the statement is "++numUsers" it means it increment the value by 1 .
  • In the else block the statement is "--numUsers" it means it decrement  the value by 1 .

4 0
3 years ago
Vlad is the leader of a group; he receives most of the messages from the group members, and he provides most of the information
LekaFEV [45]

Answer:

<u><em>Wheel </em></u>network

Explanation:

A wheel network <em>is a communication style in which the leader is the only one to receive or communicate.</em>

The leader, generally the business's manager or owner, is like the bright light in the middle of a Ferris wheel; the light starts in the middle and then passes on to all the spokes at the wheel's ends.

The one individual needs to understand everything about the company and to deliver all communications. Staff have a clear idea of how to make decisions and how to manage interaction.

6 0
3 years ago
Lawanda starts a new job today at a company that delivers thousands of packages each day. Identify three ways in which Lawanda's
jek_recluse [69]

Answer:

use your own opinion

Explanation:

7 0
3 years ago
The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
IceJOKER [234]

Answer:

name = input("Enter customer name: ")

quantity = int(input("Enter quantity: "))

size = input("Enter size [large-medium-small]: ")

if size == "large":

   sales = (quantity / 12) * 13

if size == "medium":

   sales = (quantity / 12) * 11

if size == "small":

   sales = (quantity / 12) * 8.6

   

print(name + " ordered " + str(quantity) + " " + size + " ballons")

print("Total sales is $" + str(sales))

Explanation:

*The code is in Python.

Ask the user to enter name, quantity, and size

Check the size using if structure. Depending on the size, calculate the sales using the given cost for for a dozen.

Print the order information and total sales

4 0
2 years ago
Other questions:
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • ​ If a class is reusable, that is to say that it can be used in several different applications, then it has been designed using
    5·1 answer
  • How to know if somebody else is listening my conversations by cellphone?
    13·1 answer
  • Write a function called activity which takes an integer parameter X that does the following:
    6·1 answer
  • If you’re paid hourly and work 40 hours in one week how much overtime have you worked? 8 hours none $48 or $80
    9·2 answers
  • Which option nukes your systemâall apps, programs, user files, user settingsâand presents a fresh installation of Windows?
    13·1 answer
  • Send me the answers<br>​
    15·1 answer
  • Which statement assigns the value 140 to the variable streetNumber in Python?
    13·1 answer
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
  • A(n) ______is like an intranet except it shares its resources with users from a distant location. Select your answer, then click
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!