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
fomenos
2 years ago
12

We can sort a given set of n numbers by first building a binary search tree containing these numbers (using Tree-Insert repeated

ly to insert the numbers one by one) and then printing the numbers by an inorder tree walk. What are the worst-case and best-case running times for this sorting algorithm?

Computers and Technology
1 answer:
OLga [1]2 years ago
5 0

Worst case for binary search tree -O(n)

Best case for binary search tree -O(1)

<u>Explanation:</u>

The Binary search tree is the special type of binary tree. There are two child node

  1. Left child node
  2. Right child node  
  • In that, the right child node has a value greater than it’s the parent node. The left child node has value less than it’s the parent node.
  • In the below fig. for inserting element 0, it must be inserted as the left child of 1. Therefore, for sorting we have traveled in reverse order from (3,2,1) this is the worst-case complexity O(n).

You might be interested in
What is the size of the key space if all 8 characters are randomly chosen 8-bit ascii characters?
Slav-nsk [51]
21...............................
4 0
3 years ago
Write a program that takes a point (x,y) from theuser and find where does the point lies. The pointcan
agasfer [191]

Answer:

C++ Program .

#include<bits/stdc++.h>

using namespace std;

int main()

{

int x,y;//declaring two variables x and y.

string s;//declaring string s..

cout<<"enter x and y"<<endl;

cin>>x>>y;//taking input of x and y..

if(x>=0 &&y>=0) //condition for 1st quadrant..

cout<<"the point lies in 1st Quadrant"<<endl;

else if(x<=0 &&y>=0)//condition for 2nd quadrant..

cout<<"the point lies in 2nd Quadrant"<<endl;

else if(x>=0 &&y<=0)//condition for 3rd quadrant..

cout<<"the point lies in 3rd Quadrant"<<endl;

else //else it is in  4th quadrant..

cout<<"the point lies in 4th Quadrant"<<endl;

cout<<"enter n to terminate the program"<<endl;

while(cin>>s)//if the user has not entered n the program will not terminate..

{

   if(s=="n")

   {

       cout<<"the program is terminated"<<endl;

       exit(0);

   }

   cout<<"you have not entered n please enter n to terminate the program<<endl;

}

}

Explanation:

The above written program is for telling the point lies in which quadrant.I am first declaring two variables x and y.Then after that taking input of x and y after that checking in which quadrant the point lies.

Taking input of the string s declared earlier for program termination the program will keep running until the user enters n.

4 0
2 years ago
Which term describes the second core IPSec security protocol; it can perform authentication to provide integrity protection, alt
Sphinxa [80]

Answer:

Encapsulating Security Payload (ESP)

Explanation:

Encapsulating Security Payload is also known as ESP, it is a protocol that exists within IPSec, it helps in determining the authentication, integrity and how confidential network pack data / Payload in IPV4 and IPV6 networks are.

ESP supplies messages /Payload encipher, it also helps in authenticating Payload as well as where it originated from in the IPSec protocol suite.

6 0
2 years ago
How should you respond to the theft of your identity cyber awareness.
antiseptic1488 [7]

The way to respond to the theft of your identity cyber awareness is; To report the crime to the local commission which is the Federal Trade Commission (FTC).

<h3>Protection from Identity Theft</h3>

Identity Theft is basically a crime that happens happens when someone steals your personal information and uses it commit a fraudulent offence.

Now, the person that stole your identity may use the stolen information he got from you to apply for credit, file taxes, medical services or other government privileges.

The acts perpetuated above by the thief could lead to damage to your reputation with credit status and your good name too which could take years to rebuild.

Thus, it is very pertinent to report any case of such to the relevant government commission which in this case is Federal Trade Commission (FTC).

Read more about Identity Theft at; brainly.com/question/15252417

5 0
2 years ago
How do I write a good personal narrative pls help im struggling very hard rn.​
statuscvo [17]

Answer: Find out which starter makes your partner most interested in reading your story.

1. Start with action or dialogue.

2. Ask a question or set of questions.

3. Describe the setting so readers can imagine it.

4. Give background information that will interest readers.

5. Introduce yourself to readers in a surprising way.

Explanation:

4 0
2 years ago
Other questions:
  • A hacker changing the ip addresses used in conjunction with a particular company’s web site to re-route them to the hacker’s ser
    11·1 answer
  • Why is it important to use proper line types
    13·1 answer
  • Dana downloads music into her computers random access memory, or ram, without authorization. this is?
    15·1 answer
  • The Magic Square is a grid with 3 rows and 3 columns with the following properties: • The grid contains every number from 1 to 9
    9·1 answer
  • the part of the computer that contains the brain , or central processing unit , is also known the what ?
    12·1 answer
  • Write a method reverse( ) for OurLinkedList class. The method should return a new OurLinkedList object that is the reverse of th
    8·1 answer
  • Both UDP and TCP use port numbers to identify the destination entity when delivering a message. Give at least one reason for why
    12·1 answer
  • You are configuring NIC teaming on a server with two network adapters. You chose Switch Independent Mode. You now must choose be
    15·1 answer
  • Which of the examples is part client side code
    10·1 answer
  • Write common ICT tools​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!