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
asambeis [7]
3 years ago
8

The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder traversal o

f the binary tree is:
(A) d e b f g c a
(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
2 answers:
alukav5142 [94]3 years ago
7 0

Answer:

The correct answer to the following question will be Option A (d e b f g c a).

Explanation:

In the given question the binary tree is missing, so the question is incomplete. The complete question will be:

                            a

                        /         \

                     b             c

                 /       \        /     \

               d         e    f         g

Now coming to the answer:

In this tree we are applying the post order algorithm for traversing the tree is given below:

Step 1: Go to the left-subtree.

Step 2: Go to the right-subtree.

Step 3: Print the data.

The root 'a' is follow the algorithm Post order After applying the algorithm it comes to the node 'b', 'b' is also follow the Post order algorithm then it comes to 'd', after applying the algorithm Post order it prints 'd'. Similarly all the node follow the same algorithm .

garik1379 [7]3 years ago
3 0

Answer:

Option (A)

Explanation:

In the post order traversal, we always print left subtree, then right subtree and then the root of the tree. In preorder traversal, First the root is printed, then, left subtree and at last, right subtree, so, the first element in preorder is the root of the tree and we can find elements of left sub tree from in order as all the elements written left to the root will of left subtree and similarly the right one. This is how repeating it will give the post order traversal.

You might be interested in
The stream cipher described in Definition 2.1.1 can easily be generalized to work in alphabets other than the binary one. For ma
Free_Kalibri [48]

Answer:

Check the explanation

Explanation:

1) supposing the keystream is a stream that is of random bits in Z26, we can describe a stream cipher based on the Latin Alphabet that is as follows (where A ↔ 0, B ↔ 1, C ↔ 2 etc):

y_{i} =x_{i} +k_{i} mod26

x_{i} =y_{i} -k_{i} mod26

2)

x_{i} =y_{i} -k_{i} = ” B ” − ” R ” = 1 − 17 = − 16 ≡ 10 mod 26 = ” K ” etc ·

The Decrypted Text is: ”KASPAR HAUSER”

8 0
3 years ago
Many languages distinguish between uppercase and lowercase letters in user-defined names. What are the pros and cons of this des
Korvikt [17]

Answer:

Explanation:

The reasons why a language would distinguish between uppercase and lowercase in its identifiers are:

(1) So that variable identifiers may look different than identifiers that are names for constants, such as the convention of using uppercase for constant names and using lowercase for variable names in C.

(2) So that the catenated words such as names can have their first letter distinguished, as in Total Words. The primary reason why a language would not distinguish between uppercase and lowercase in identifiers is it makes programs less readable, because words that look very similar are actually completely different, such as SUM and Sum.

7 0
3 years ago
Hello everyone. I need help. C programming. Create at least two more functions except the main () function to collect them.
Andrew [12]

Answer:

Explanation:

#include <iostream>

using namespace std;

int costdays(int);

int costhrs(int,int);

int main()

{

   int dd,hh,mm,tmph,tmpd,tmpm=0;

   int pcost,mcost=0;

   cout<<"Enter Parking time" << endl;

   cout<<"Hours: ";

   cin>>hh;

   cout<<"Minutes: ";

   cin>>mm;

   

   if (mm>60)

   {

       tmph=mm/60;

       hh+=tmph;

       mm-=(tmph*60);

   }

   if (hh>24)

   {

       tmpd=hh/24;

       dd+=tmpd;

       hh-=(tmpd*24);

   }

   if ((hh>4)&&(mm>0))

   {

       pcost+=costdays(1);

   }

   else

   {

       mcost=costhrs(hh,mm);

   }

   cout<<"Total time: ";

   if (dd>0)

   {

       cout<<dd<<"days ";

       pcost+=costdays(dd);

   }

   pcost+=mcost;

   cout<<hh<<"h "<<mm<<"mins"<<endl;

   cout<<"Total Cost :"<<pcost<<"Won";

   return 0;

}

int costdays(int dd)

{

   return(dd*25000);

}

int costhrs(int hh,int mm)

{

   int tmpm, tmp=0;

   tmp=(hh*6)*1000;

   tmp+=(mm/10)*1000;

   tmpm=mm-((mm/10)*10);

   if (tmpm>0)

   {

       tmp+=1000;

   }

   return(tmp);

}

3 0
3 years ago
Suppose that a 64MB system memory is built from 64 1MB RAM chips. How many address lines are needed to select one of the memory
alexdok [17]

Answer:

6 address lines

Explanation:

The computation of the number of address lines needed is shown below:

Given that

Total memory = 64MB

= 2^6MB

=2^{26} bytes

Also we know that in 1MB RAM the number of chips is 6

So, the number of address lines is 2^{26} address i..e 26 address lines

And, the size of one chip is equivalent to 1 MB i.e. 2^{20} bytes

For a single 1MB chips of RAM, the number of address lines is

\frac{2^{26}}{2^{20}} \\\\= 2^6 address

Therefore 6 address lines needed

5 0
3 years ago
. Which of the following is NOT a
joja [24]

Answer:

solution

Explanation:

The correct option is - solution

Reason -

To solve a problem,

Firstly we give input , then system will process that input which then gives output.

Solution is not a part of the process.

So, Solution is not a significant part of a simple problem.

7 0
3 years ago
Other questions:
  • _____________ is the characteristic of a resource that ensures that access is restricted to only permitted users, applications,
    14·1 answer
  • __________ ensure that hardware and software produced by different vendors work together.
    14·1 answer
  • In C, developers may access arrays via bracketed syntax like Java or by using * dereferencing notation. The following assignment
    5·1 answer
  • Janet manages the security of the database servers at the mortgage company where she works. The servers are Windows Server 2016;
    15·1 answer
  • PLEASE HELP ASAP
    10·2 answers
  • Circular error are caused by adding the cell name of a/an cell to aformula
    7·1 answer
  • A class is a _____, which encapsulates _____ and _____. (Points : 2) programming language construct; attributes; behavior
    7·1 answer
  • Lasses give programmers the ability to define their own types. <br><br> a. True<br> b. False
    10·1 answer
  • What do you get with brainly points
    9·1 answer
  • Functions are used to _________
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!