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
Semmy [17]
3 years ago
6

The postorder and preorder traversal of a binary tree are given below - postorder : D E B F G C A preorder : A B D E C F G respe

ctively a. D B E A F C G b. E D B G F C A c. E D B F G C A d. D E F G B C A

Computers and Technology
1 answer:
jeka57 [31]3 years ago
6 0

Answer: The answer is A

Explanation:

in  the attachment

You might be interested in
11111 Power 2 sovle ​
erastovalidia [21]
123,454,321. you just multiply 11111 by itself
4 0
3 years ago
write a program that computes an integer's checksum. to compute the checksum, break the integer into its constituent
Serggg [28]

Using the knowledge in computational language in python it is possible to write a code that computes an integer's checksum.

<h3>Writting the code:</h3>

<em>def checkSum(n):                    # Function definition</em>

<em>    total = 0                       # total variable which returns sum</em>

<em>    c = 0                           # counter variable which count the even position</em>

<em>    while(n!=0):                    # running a loop while n != 0</em>

<em>        r = int(n%10)               #breaking the number into digits</em>

<em>        c=c+1                       # increase counter</em>

<em>        if c%2==0:                  # if counter is even position then double the number </em>

<em>            r = r*2</em>

<em>            while(r!=0):                            # do the process</em>

<em>                total = total + int(r%10)</em>

<em>                r = int(r/10)</em>

<em>            n=int(n/10)    </em>

<em>        else:                       # if counter is odd position then simple add the digit </em>

<em>            total = total + r       # into total</em>

<em>            n=int(n/10)</em>

<em>    return total                    # in the last return the sum of digits</em>

<em># Driver code</em>

<em>n = int(input("Enter Number:"))         # asking user to enter the number </em>

<em>print(checkSum(n))                      # calling the function</em>

See more about python at brainly.com/question/18502436

#SPJ1

8 0
1 year ago
ANYONE WANNA FRIEND ME ON DISCORD ゴRose joestarゴ#2088
Sergeeva-Olga [200]

JOJO fan!?!!?!??!?!?!!?!?

6 0
3 years ago
At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase
Alina [70]

Answer:

  1. var projected_fee = 6000;  
  2. for(var i = 1; i <= 5; i++){
  3.    projected_fee = projected_fee * 0.02 + projected_fee;
  4.    console.log("$" + projected_fee.toFixed(2));
  5. }

Explanation:

Firstly, create a variable, projected_fee, and set the initial tuition fee value to it (Line 1).

Next, user a for loop that run for 5 times to repeatedly calculate the projected_fee based on 2 percent of increment rate (Line 4) and display the projected fee to console terminal (Line 5). The output should be

$6120.00

$6242.40

$6367.25

$6494.59

$6624.48

8 0
3 years ago
A perfect binary tree is a complete binary tree with all levels fully filled. Add a method in the BST class to return true if th
algol [13]

Answer:

class BST {

static class Node

{

int val;

Node left, right;

}

static boolean checkPerfectBT(Node node, int h, int d)

{

if (node == null)

return true;

 

if (node.left == null && node.right == null)

{

if(h==d+1)

return true;

else

return false;

}

 

if (node.left == null || node.right== null)

return false;

 

return checkPerfectBT(node.left, h, d+1) && checkPerfectBT(node.right, h, d+1);

}

static int height(Node node)

{

int dep = 0;

while (node != null)

{

node = node.right;

dep=dep+1;

}

return dep;

}

static boolean isPerfectBT(Node node)

{

int h = height(node);

return checkPerfectBT(node, h, 0);

}

 

static Node addNode(int x)

{

Node node = new Node();

node.val= x;

node.right = null;

node.left = null;

return node;

}

public static void main(String args[])

{

int i,j,k;

Node node= null;

node = addNode(34);

node.left = addNode(2);

node.right = addNode(322);

 

node.left.left = addNode(21);

node.left.right = addNode(23);

node.right.left = addNode(37);

node.right.right = addNode(54);

 

if (isPerfectBT(node) == true)

System.out.println("This is a Perfect Binary tree");

else

System.out.println("This is Not a perfect Binary Tree");

}

}

Explanation:

  • Calculate the depth of BST by using a while loop until it reaches a null value.
  • In the addNode method, make an object of Node class.
  • In the main method, pass the values to addNode method.
  • Finally display the relevant message to show if it's Perfect or not.
6 0
3 years ago
Other questions:
  • Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
    14·1 answer
  • As you move the click and type pointer around the document, the icon changes to represent ____________________ that will be appl
    10·2 answers
  • Suppose that you created an robot that was so advanced it could act independently in very complex situations. It made its own de
    9·1 answer
  • What will the output be from the following program?
    5·1 answer
  • Why is a class called a factory of objects
    11·1 answer
  • What type of version of visual studio is the visual studio express
    8·1 answer
  • The list method reverse reverses the elements in the list. Define a function named reverse that reverses the elements in its lis
    10·1 answer
  • Write a program that removes all non-alphabetic characters from the given input.
    7·1 answer
  • The…..executed simple
    8·2 answers
  • How has 5G become more energy efficient?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!