Write down the order in which the nodes would be visited

Assignment Help Other Subject
Reference no: EM133185954

Questions 1 - 5 are on binary trees. You will be working with different datasets, specified individually for each student.

Your dataset will consist of a sequence of 15 four letter strings. Follow the instructions below to construct your dataset.

a. Write down your first name and your surname. My name is Juris Barlots

b. Under each letter write the position of that letter in the alphabet, i.e., 1 for A, 2 for B, . . . , 26 for Z.

c. Add up the numbers to get a 3-digit total, say XYZ (if the total is less    than 100 the first digit is 0).

d. Add 1 to YZ to get a line number between 1 and 100.

e. X specifies the position on the line: for X = 0, start at the 1st word;
for X = 1, start at the 5th word (continue on the next line if necessary); for X ≥ 2, start at the 10th word (continue on the next line if necessary).

f. Open the file TEXTE.pdf and start at position X on line YZ+1. Write down the next 15 words, replacing any capital letters by lower-case letters. Ignore all words with fewer than four letters (and also any numbers) and any word for which the first four letters are the same as those for any of your previous words.

g. Write down the sequence of 15 distinct four-letter strings obtained by taking the first four letters of each of the 15 words. This is your personal dataset.

Question 1: Draw the binary search tree obtained by inserting the 15 strings, in the order they occurred in the text, into an initially empty binary search tree.
Add in the threads to turn your tree into a threaded binary tree.

Question 2: Write down the order in which the nodes would be visited if the tree was traversed in postorder.

Question 3: Traverse the tree in preorder using the non-recursive algorithm on p.18 of the notes. Write down the order in which the nodes would be visited and also the stack contents immediately after the 3rd, 6th, 9th and 12th of the 15 nodes have been visited.

Question 4: Starting with your (unthreaded) binary search tree obtained in Question 1, draw the 3 binary trees resulting after deleting in order, one by one, the 1st, 2nd and 3rd of the 15 strings you inserted into the tree, each time deleting from the tree that resulted from the previous deletion. (You must use the deletion algorithm on p.29 of the notes.)

Question 5: Draw the forest corresponding to your original binary search tree obtained in Question 1 using the natural correspondence between forests and binary trees.

Question 6: On p.21 of the notes, two alternative interpretations of right-insertion in a threaded binary tree are depicted. The algorithm given was for the first interpretation. Write down a similar algorithm for the second interpretation, i.e. where the subtree rooted at R becomes the left subtree of the inserted node Q.

7-9 are on B-trees and are in the file: Q789X.pdf Notes for Questions 7, 8 and 9

Question 7:
You must adopt a consistent strategy throughout for splitting and merging pages:

(a) You must split all pages with an odd number of items in a consistent way, i.e. the extra item should either always go in the left-hand page or always go in the right- hand page.

(b) When merging a page having two sibling pages, you must either always merge it with the left-hand sibling page or always with the right-hand sibling page.

Reference no: EM133185954

Questions Cloud

What is the net realizable value of the accounts receivable : Accounts Receivable has a balance of $682,813 and Allowance for Doubtful Accounts has a balance of $21,001. What is the net realizable value of the accounts
Prepare the lower portion of the income statement : Prepare the lower portion of the 2021 income statement beginning with income from continuing operations before income taxes
What is the payback period of the system : An upgrade will be performed on the system at the end of the third year at a cost of $15,000. What is the payback period of the system
Controversy surrounding emotional intelligence : You have already read Adler and discussed Cultural Synergy. You have read about the controversy surrounding Emotional Intelligence (EI). Cultural Intelligence (
Write down the order in which the nodes would be visited : Write down the order in which the nodes would be visited if the tree was traversed in postorder and Draw the forest corresponding to your original binary search
Calculate the beginning direct materials inventory : CWB maintains an ending inventory of materials equal to 4 percent of the next quarter's production needs. Calculate the beginning direct materials inventory
Record the foregoing transactions : The PYT Corporation has an authorized shares of 250,000 with a par value of Php70. 100,000. Record the foregoing transactions
How much is the inventory to be reported by abc : How much is the inventory to be reported by ABC in its books assuming the inventory is not yet sold as of year-end
Analysis of the stakeholder environment : 1. Based upon your analysis of the stakeholder environment faced by Western creditors in Thailand, should they undertake a

Reviews

Write a Review

Other Subject Questions & Answers

  Was is an appropriate action

Why did Jack in the Box remove the toys from their kid's meals? Was this is an appropriate action? Why or why not?

  Role in the puritans settlement in america

Religion plays a central role in the Puritans' settlement in America. William Bradford, John Winthrop, Anne Bradstreet and other Puritan colonizers

  Considering that a healthcare organization

Considering that a healthcare organization has numerous regulatory requirements to meet, answer the following question about this organization. What short term and long term actions can the organization take to come into regulatory compliance (with i..

  Concurrent validity comes before predictive validity

Assembly line workers, sales clerks, and production personnel fall into the ofMintzberg's five parts of an organization?

  What does over-pumping of aquifers really mean

Explain how the continued over-pumping of aquifers in America, China, and India, could impact our ability to survive on the planet.

  What your favorite genre of film and why

In a one or two page paper first state what your favorite genre of film is(romantic comedy, the screen musical, the western, horror, suspense, thriller, documentary/docudrama, fictionalized biography, comedy drama, film noir, etc.)and explain why ..

  Describe role of public health in the monitoring of disease

Describe the role of public health in the monitoring of disease. Explain the need to standardize data sets in measuring population health. Analyze how population health is measured and aggregated nationally.

  A cardiac patient recovering from open-heart surgery

A cardiac patient recovering from open-heart surgery complains to a nurse that she was having mild chest pain and shortness of breath. The nurse is on her way to lunch. She decides to wait until after lunch to inform the patient’s treating physician

  How media and communication affect development of children

Discuss your understanding on: How do media and other means of communication can affect (Positively or Negatively) the development of children?

  Academic journals annotated bibliography

Academic Journals Annotated Bibliography. you will need to have a minimum of 3 scholarly academic journal articles to support your claims

  Psychological issues summary

Therapeutic strategies that integrate the humanistic approach are effective for treating children who suffer from emotional disturbances and display maladaptive behaviors.

  Linear time-invariant dynamic systems

Discuss what is meant by linear time-invariant dynamic systems.  Provide some practical examples. Discuss how feedback allows systems with large gain to become more stable.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd