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
write a program with total change amount as an integer input and output the change using the fewest coins, one coin type per lin
notka56 [123]

Answer:

Explanationoojhh

8 0
3 years ago
Friday Night Funkin Fans, does this count as a leak if I share it?
Aliun [14]
Hmm no I don’t think so
7 0
2 years ago
Read 2 more answers
Explain how can you protect your computer from malware
rosijanka [135]
Trend micro security for your Mac or pc or trend micro mobil security for your android or iOS Mobil device?

Hope this helps!
6 0
3 years ago
Read 2 more answers
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
2 years ago
Read 2 more answers
What is one similarity between compiled and interpreted programming languages? (5 points)
Rashid [163]

Answer:

Both compiled and interpreted languages are high-level languages and translate code for a computer to understand.

Explanation:

The one similarity between compiled and interpreted languages is that they are both high-level languages.

A high-level language is a computer language written in easy to understand human language which is then converted to machine code for the computer to understand.  

A high-level language can either be interpreted or compiled.

An interpreted is a language in which the code is translated line by line before execution while a compiled language is one in which the source code is converted directly into machine language before execution.

So, <u>the similarity between both languages is that they are high level languages and translate code for a computer to understand. </u>

8 0
2 years ago
Other questions:
  • When purchasing a(n) ________ computer, having cellular as well as wifi can be important?
    9·1 answer
  • The term integration refers to the ability to
    6·1 answer
  • Which field in a Transmission Control Protocol (TCP) header provides the next<br> expected segment?
    5·1 answer
  • Your program will search for prime numbers. You will first ask the user for the range of values to search, and use for loops to
    6·1 answer
  • Retype and run, note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks.
    9·1 answer
  • I need a explanation for this 02 question for a test I will have .
    11·1 answer
  • Write the header file Stadium.h for a Stadium class. The Stadium class has the following data members: 1) an array of 1000 Seat
    7·1 answer
  • Please answer me fast ​
    6·2 answers
  • A construction-based client would like to develop an application that can analyze an image of machinery and overlay information
    8·1 answer
  • // This pseudocode is intended to describe
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!