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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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