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

Build a binary search tree for the words oenology, phrenology, campanology, ornithology, ichthyology, limnology, alchemy, and as

trology using alphabetical order.
Computers and Technology
1 answer:
Butoxors [25]3 years ago
3 0
<h2>Answer:</h2>

The diagram is attached to this response.

<h2>Explanation:</h2>

In a binary search tree (BST), a node may have a right child and/or a left child which are also nodes, and the following properties hold:

i. the left subtree of a node has nodes whose keys are lesser than that of the given node.

ii. the right subtree of a node has nodes whose keys are greater than that of the given node.

Given words are:

oenology, phrenology, campanology, ornithology, ichthyology, limnology, alchemy, astrology

To build a binary search tree with the given words, do the following:

(i) The first word in the list is the root node of the tree. In this case, the root node is oenology.

(ii) The second word is phrenology. Using alphabetical ordering and relative to the root word (oenology), phrenology tends to be after oenology. Therefore, phrenology is going to be to the right of oenology.

(iii) The third word is campanology. Using alphabetical ordering and relative to the root word (oenology), campanology should be before oenology. Therefore, campanology is going to be to the left of oenology.

(iv) The fourth word is ornithology. Using alphabetical ordering and relative to the root word (oenology), ornithology should be after oenology. Therefore, ornithology is going to be to the right of oenology. Also, since phrenology is already to the right of oenology, ornithology would be to the left of phrenology as alphabetical ordering shows that ornithology is before phrenology. In essence, ornithology would be placed right to oenology but left to phrenology.

(v) The fifth word is ichthyology. Using alphabetical ordering and relative to the root word (oenology), ichthyology should be before oenology. Therefore, ichthyology is going to be to the left of oenology. Also, since campanology is already to the left of oenology, ichthyology would be to the right of campanology as alphabetical ordering shows that ichthyology is after campanology. In essence, ichthyology would be placed left to oenology but right to campanology.

(vi) The sixth word is limnology. Using alphabetical ordering and relative to the root word (oenology), limnology should be before oenology. Therefore, limnology is going to be to the left of oenology. Also, since campanology is already to the left of oenology, limnology would be to the right of campanology as alphabetical ordering shows that limnology is after campanology.  Also, since ichthyology is already to the right of campanology, limnology would be to the right of ichthyology as alphabetical ordering shows that limnology is after ichthyology.  In essence, limnology would be placed left to oenology, right to campanology but right to ichthyology.

(vii) The seventh word is alchemy. Using alphabetical ordering and relative to the root word (oenology), alchemy should be before oenology. Therefore, alchemy is going to be to the left of oenology. Also, since campanology is already to the left of oenology, alchemy would be to the left of campanology as alphabetical ordering shows that alchemy is before campanology. In essence, alchemy would be placed left to oenology but left to campanology.

(viii) The eighth word is astrology. Using alphabetical ordering and relative to the root word (oenology), astrology should be before oenology. Therefore, astrology is going to be to the left of oenology. Also, since campanology is already to the left of oenology, astrology would be to the left of campanology as alphabetical ordering shows that astrology is before campanology.  Also, since alchemy is already to the left of campanology, astrology would be to the right of alchemy as alphabetical ordering shows that astrology is after alchemy.  In essence, astrology would be placed left to oenology, left to campanology but right to alchemy.

You might be interested in
The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons
Lilit [14]

Answer:

coupons = int(input("Enter the number of coupons you win: "))

candy_bars = int(coupons / 10)

gumballs = coupons % 10

print("Candy bars: " + str(candy_bars) + ", Gumballs: " + str(gumballs))

Explanation:

*The code is in Python.

Ask the user to enter the number of coupons

Calculate the number of candy bars, divide the coupons by 10 and typecst the result to int

Calculate the number of gumballs, use the modulo to find the remainder

Print the values

3 0
3 years ago
Why when you are on wifi it keeps kicking you off is your class during online learning​
Leviafan [203]
Sometimes, it lags on the other side or from the teachers computer so the app just kicks people out sometimes, it’s sucks I know
7 0
3 years ago
Read 2 more answers
Write a program that asks the user to enter the amount s/he has budgeted for a month. The amount should be between 1000 and 2000
Elena-2011 [213]

Answer:

The program to this question can be given as:

Program:

  //import package for user input.

import java.util.*;      

//define class

public class Budget                      

{

public static void main(String [] a)            //define main method.

{

//creating Scanner class object.

Scanner ob =new Scanner(System.in);    

//define variable.      

double budgetamount=0, amountspent=0 ,difference=0,total=0,num=0 ;        

int count = 0;                            

System.out.println("How much have you budgeted for the month? :");        //print message.

budgetamount=ob.nextDouble();                             //taking input

       while(budgetamount != 0)           //checkig number greater then 4 digite.

       {

           budgetamount= budgetamount/10;        

           ++count;

       }

       if(count>4)                 //condition

       {

       System.out.println("enter each expense, then type -999 to quit: ");

       while(num!=-999)               //taking expense  

       {

       total=total+num;                 //totaling expense

       num=scan.nextDouble();                  

       }

       if(total<=budgetamount)           //condtion for over budget.

       {

       System.out.print("under budget:");         //print message

       System.out.print(budgetamount-total);

       }

       else

       {

       System.out.print("over budget:");              //for under budget

       System.out.print(total-budgetamount);

       }

       }

       else

       {

       System.out.println("not valid");        //message for number lessthen 4 digit.    

       }                                      

}

}

output:

How much have you budgeted for the month? : 1200.55.

enter each expense, then type -999 to quit: 365.89

556.90

339.98

-999

over budget:1262.77

Explanation:

The explanation of this program can be given as:

In the above program we import the package in that is used for scanner class. This class is used for the input from the user after input we use the while loop and if-else statement. The while loop is the entry control loop It is used for input validation and if-else is used for the checking condition. Then we insert expense that is inserted by the user. Then we calculate under-budgeted and over-budgeted by conditional statement that is if-else. and at the last we print it.

5 0
3 years ago
Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
disa [49]

Answer:

Sandboxing.

Explanation:

SDLC or software development life cycle is a systematic approach to software development. It marks the birth and death of an application.

The application development starts from the research of the properties of the application to the design and development or implementation of the application.

After the implementation of the software, it is tested, comparing the design and the codes in the development process. The sandboxing testing process helps to isolate and test new lines of code added during the testing phase.

3 0
3 years ago
Which term refers to the science that specifies the design and arrangement of items you use so you interact with the items effic
sashaice [31]

Answer:

the ergonomics To prevent a laptop from being stolen, you can use a surge protector. False; To prevent laptops from being stolen, you can use a cable lock. What is a digital certificate?

6 0
2 years ago
Other questions:
  • A(n) ____ loop executes a predetermined number of times.
    12·1 answer
  • Word 2013 in order to share a document online you must first
    10·1 answer
  • What is one problem you should keep in mind when researching information on the Internet?
    6·2 answers
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
    12·1 answer
  • How do you delete a slide from your presentation after selecting it
    8·1 answer
  • Name three types of hard drives, along with its speed and size.
    8·1 answer
  • Hey, how is everyone????????????????????????????????
    8·2 answers
  • When proposing a plan in detail for video production phases, fundraising, and outreaching, which section will you use to make su
    14·2 answers
  • Instructions
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!