Question

In: Computer Science

Want to double check the work I did for these questions to make sure they were...

Want to double check the work I did for these questions to make sure they were done right:

  1. Build a BST using the following numbers: 16,12,56,7,19,2,9 Build the tree in the order in which the numbers appear.
  2. Using the above numbers, build an AVL balanced binary tree
  3. Using the numbers and assuming they are stored in an array, show the array after the third pass of the selection sort
  4. Using the numbers and assuming they are stored in an array, show the array after the third pass of the insertion sort
  5. Given the follow adjacency matrix:

0 1 0 0 0

1 0 0 0 1

1 0 0 1 0

0 0 1 0 1

0 0 0 0 0

draw the adjacency List

Solutions

Expert Solution

A) Build a BST using the following numbers: 16,12,56,7,19,2,9 Build the tree in the order in which the numbers appear.

Steps are as follows

1) insert 16

2) insert 12

3) insert 56

4) Insert 7

5) Insert 19

6) Insert 2

7) Insert 9

Here is the final Binary Search Tree:

B) Using 16,12,56,7,19,2,9, build an AVL balanced binary tree

Steps are as follows

1) Insert 16

2) Insert 12

3) Insert 56

4) Insert 7

5) Insert 19

6) Insert 2

7) Insert 9

here is the final AVL Tree

C)  Using 16,12,56,7,19,2,9 and assuming they are stored in an array, show the array after the third pass of the selection sort

Initially

after 1st pass:

after 2nd pass:

after 3rd pass:

D)  Using 16,12,56,7,19,2,9 and assuming they are stored in an array, show the array after the third pass of the insertion sort

Initially :

after 1st pass:

after 2nd pass:

after 3rd pass:

E) Given the following adjacency matrix:

0 1 0 0 0

1 0 0 0 1

1 0 0 1 0

0 0 1 0 1

0 0 0 0 0

draw the adjacency List

a) Adjacency Matrix

b) Graph

c) Adjacency List

d) Edge List

*** If you have any doubts regarding the solution, please do ask in comments ***


Related Solutions

Hello! I have worked out all these questions, but want to double check them with your...
Hello! I have worked out all these questions, but want to double check them with your answers before submitting them. Thanks! 1. On December 31, 20X1, a company adopted the dollar-value LIFO inventory method. Inventory at the end of 20X1 for its only inventory pool was $400,000 under the dollar-value LIFO method. At the end of 20X2, inventory at year-end cost is $473,000 and the cost index is 1.10. At the end of 20X3, inventory at year-end cost is $492,000...
I've did most of the work i just need someone to check if my work is...
I've did most of the work i just need someone to check if my work is correct Maryam and Hanadi are planning to open a shop to sell female shoes in Abu Dhabi. The venue of the shop is decided to be a rented premises in Marina Mall. They wish to start their operations from 01 July, 2020. The following information is available about the company’s operations. i. The company predicts a sale price of AED 350 per unit. Sales...
I am not sure if the ones that I did answer were correct and wanted to...
I am not sure if the ones that I did answer were correct and wanted to make sure. Answer the following questions about the anatomy of muscle: Combination of myofilaments lead to formation of ______________________ Myosin is the make-up of the ______thick______________ filament, while actin protein is the make-up of _______thin_____________ filament   Plasma membrane of muscles are known as ______sarcolemma_____________________ Sarcolemma dips down into the cell to produce tube like structures known as _____________________ Connective tissue that wraps around multiple...
Please answer the following questions and show all work and make sure I can read your...
Please answer the following questions and show all work and make sure I can read your writing please. 1) Ethan went on a 10 day fishing trip. The number of small mouth bass caught and released by Ethan each day was as follows. Day 1 2 3 4 5 6 7 8 9 10 # of Fish 9 24 8 9 5 8 9 10 8 10 A. Find the mean, median, and mode B. Find the range, variance, and...
Hi! I am working on a lab for Organic Chemistry and I want to make sure...
Hi! I am working on a lab for Organic Chemistry and I want to make sure my answers are correct before submitting it! Thank you in advance! Stereoisomerism: A Model Exercise In this experiment you will construct models with your molecular model set that illustrate the concepts of chirality, chiral center (stereogenic center, asymmetric carbon atom), enantiomers, diastereomers, and meso forms. You will also learn about two conventions, R-S and Fischer, for designating the configurations of chiral molecules. You will...
I need a NPV calculation. I just want to make sure I got it correct. Initial...
I need a NPV calculation. I just want to make sure I got it correct. Initial Cost at t=0 is $150 rate = 16% growth rate in perpetuity after year 5 at 1.5% Year 1 2 3 4 5 Cash Flow 5 11.4 14 21 28
For this week, I want to make sure you have a good, basic grounding in the...
For this week, I want to make sure you have a good, basic grounding in the principles of central tendency. Most statistics operates around two principles: central tendency and dispersion. Central tendency tells us where the "middle" of a set of data is, while "dispersion" allows us to see how spread out the data are from the middle. This week, we are covering central tendency. Your first assignment is to use the Excel Data Analysis add-in (or a calculator or...
Hi! Below is the case study and I want to make sure I'm on the right...
Hi! Below is the case study and I want to make sure I'm on the right track. I bolded the questions I'm interested in (1-5). Looking for people who are familiar with the DSM-5/abnormal psychology and able to answer all questions completely. Thank you! Detailed answers extremely appreciated! Questions: 1. Diagnosis; what is the evidence for it? 2. Treatment; typical treatment used for this diagnosis AND most effective treatment. IF the person is in treatment, what should we target first...
Hi! Below is the case study and I want to make sure I'm on the right...
Hi! Below is the case study and I want to make sure I'm on the right track. I bolded the questions I'm interested in (1-5). Looking for people who are familiar with the DSM-5/abnormal psychology and able to answer all questions completely. Thank you! - no ICD 10 please! Questions: 1. Diagnosis; what is the evidence for it? For this one, assume the patient has borderline disorder and answer the rest accordingly. 2. Treatment; typical treatment used for this diagnosis...
Hi! Below is the case study and I want to make sure I'm on the right...
Hi! Below is the case study and I want to make sure I'm on the right track. I bolded the questions I'm interested in (1-5). Looking for people who are familiar with the DSM-5/abnormal psychology and able to answer all questions completely. Thank you! Questions: 1. Diagnosis; what is the evidence for it? 2. Treatment; typical treatment used for this diagnosis AND most effective treatment. IF the person is in treatment, what should we target first in terms of symptoms?...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT