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
ale4655 [162]
3 years ago
5

A complete traversal of an n node binary tree is a(n)____ "operation if visiting a node is O(1)for the iterative implementation

Computers and Technology
1 answer:
ch4aika [34]3 years ago
8 0

Answer:

B.O(n).

Explanation:

Since the time complexity of visiting a node is O(1) in iterative implementation.So the time complexity of visiting every single node in binary tree is O(n).We can use level order traversal of a binary tree using a queue.Which can visit every node in O(n) time.Level order traversal do it in a single loop without doing any extra traversal.

You might be interested in
9.10: Reverse ArrayWrite a function that accepts an int array and the array ’s size as arguments . The function should create a
AleksandrR [38]

Answer:

#include <iostream>

using namespace std;

int * reverse(int a[],int n)//function to reverse the array.

{

   int i;

   for(i=0;i<n/2;i++)

   {

       int temp=a[i];

       a[i]=a[n-i-1];

       a[n-i-1]=temp;

   }

   return a;//return pointer to the array.

}

int main() {

   int array[50],* arr,N;//declaring three variables.

   cin>>N;//taking input of size..

   if(N>50||N<0)//if size greater than 50 or less than 0 then terminating the program..

   return 0;

   for(int i=0;i<N;i++)

   {

       cin>>array[i];//prompting array elements..

   }

   arr=reverse(array,N);//function call.

   for(int i=0;i<N;i++)

   cout<<arr[i]<<endl;//printing reversed array..

   cout<<endl;

return 0;

}

Output:-

5

4 5 6 7 8

8

7

6

5

4

Explanation:

I have created a function reverse which reverses the array and returns pointer to an array.I have also considered edge cases where the function terminates if the value of the N(size) is greater than 50 or less than 0.

8 0
3 years ago
Imagery functions as a coding system to help individuals acquire movement patterns. this describes
denis-greek [22]

Answer:

Imagery can be used to develop qualities in yourself you'd like to have — it's like emotional body-building — and using a technique called “Evocative Imagery” you can cultivate courage, patience, tolerance, humor, concentration, self-confidence or any other quality you'd like to embody.

3 0
2 years ago
Write a program that reads in the following data, all entered on one line with at least one space separating them: a) an integer
Rina8888 [55]

Answer:

import java.util.Scanner;

public class DataConstraint {

public static void main(String[] args) {

System.out.print("Enter month, day, year separated by spaces :");

Scanner sc=new Scanner(System.in);

int M,D,Y;

M=sc.nextInt();

D=sc.nextInt();

Y=sc.nextInt();

if(1<=M && M<=12 && 1<=D && D<=31 && Y>=1)

{

if(M==4 || M==6 ||M==9 || M==11){

if(D==31) {

System.out.println("month "+M+" can not have more than 30 days");

System.exit(0);

}

}

else if(M==2)

{

if((Y%400==0) || (Y%4==0 && Y%100!=0)) {

if(D>=30) {

System.out.println("month "+M+" cannot have "+D+" days");

System.exit(0);

}

}

else {

if(D>=29) {

System.out.println(Y+" is not a leap year, "+D+" is invalid");

System.exit(0);

}

}

}

System.out.println(M+" "+D+" "+Y+" is a valid date");

}

else{

if(1>=M || M>=12) System.out.println(M+" is not a valid month");

if(1>=D || D>=31) System.out.println(D+" is not a valid date");

if(Y<1) System.out.println("year can not be negative");

}

}

}

Explanation:

  • Use a conditional statement to check the month is between 1 and 12.
  • Check that the date is between 1 and 31 and year must be positive value.
  • If no. of days are more than 29, then the year cannot be a leap year.

4 0
3 years ago
Why can't we sign up to brainly.com??????????????????
LiRa [457]

Answer:

Explanation:

so why are you doing sign up

8 0
3 years ago
Specialized vocabularyis known as:
svet-max [94.6K]

Answer:

<u>"Jargon"</u>

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

<em>Specialized vocabulary</em> is sometimes also known as <u>"Jargon"</u> . These are sets of words that are used specifically and uniquely for specific sets of groups or organizations.

For example Lawyers Judges and other law enforcement officials have their own Specialized vocabulary that are better understood by other people in Law enforcement, people that are not part of Law Enforcement might have a hard time understanding.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
Other questions:
  • 1. Write the name of the tab, command group, and icon that is used to sort information in a Word document.
    12·2 answers
  • File-sharing programs such as Napster, Kazaa, and iMesh make it possible for individuals to exchange music files over the Intern
    7·1 answer
  • When preparing a document flowchart, the names of organizational departments or job functions should appear in theA) column head
    6·1 answer
  • In a c program, if you see a variable in main declared: float farray[20]; describe what farray is
    10·1 answer
  • Create the following SQL Server queries that access the Northwind database. Place them in a zip file and place the zip file in t
    6·1 answer
  • State ONE (1) disadvantage of using computers to store and process<br> information.
    10·1 answer
  • 1. Answer the following questions: a. What are the different types of number system? Name them.​
    8·1 answer
  • What is a function of Agile software development?<br>​
    7·1 answer
  • You want to substitute one word with another throughout your
    13·1 answer
  • Necesito 7 innovaciones tecnológicas de la informática para 2021
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!