Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question 1:

Can you implement the dynamic-set operation INSERT on a singly linked list in O(1) time? How about DELETE?

Question 2:

Suppose we have stored n keys in a hash table of size m, with collisions resolved by chaining, and that we know the length of each chain, including the length L of the longest chain. Describe a procedure that selects a key uniformly at random from among the keys in the hash table and returns it in expected time O(L . (1 + 1/α)).

Question 3:

Give a nonrecursive algorithm that performs an inorder tree walk. (Hint: An easy solution uses a stack as an auxiliary data structure. A more complicated, but elegant, solution uses no stack but assumes that we can test two pointers for equality.)

Question 4:

Show that if a node in a binary search tree has two children, then its successor has no left child and its predecessor has no right child.

Question 5:

Give a recursive version of the TREE-INSERT procedure.

Question 6:

Why don't we allow a minimum degree of t = 1?

Question 7:

As a function of the minimum degree 1, what is the maximum number of keys that can be stored in a B-tree of height h?

Question 8:

Explain how to find the minimum key stored in a B-tree and how to find the prede-cessor of a given key stored in a B-tree.

Below is the TREE-DELETE procedure

TREE-DELETE(T, Z)

1 if z.left == NIL

2       TRANSPLANT(T, z, z. right)

3 elseif z.right == NIL

4       TRANSPLANT(T, z, z. left)

5 else y = TREE-MINIMUM (z. right)

6       if y.p ≠ z

7       TRANSPLANT(T, y, y. right)

8       y.right = z.right

9       y.right.p = y

10     TRANSPLANT(T, z, y)

11     y.left = z.left

12     y. left. p = y

Exercise A1

Follow the TREE-DELETE procedure described in Chapter 12, show step-by-step output of each of the following operations applied on the binary search tree below.

2292_figure2.jpg

a) Delete node 3.

b) Based on output from step a), delete node 7.

c) Based on output from step b), delete node 18.

Note: Strictly speaking, node i in the question should be interpreted as "a node that is represented by its key value of i".

B-TREE-INSERT (T, k)
1 r = T. root
2 if r.n==2t - 1
3 s = ALLOCATE-NODE 0
4 T. mot = s
5 s.leaf = FALSE
6 s.n = 0
7 s.c, = r
8 B-TREE-SPLIT-CHILD(S, 1)
9 B-TREE-INSERT-NoNFuLL(s,k)
10 else B-TREE-INSERT-NONFULL (r, k)

Exercise A2

Follow the B-TREE-INSERT procedure described in Chapter 18, show step-by-step output of each of the following operations applied on the B-tree below. Note that the B-tee has a minimum degree r=3 and the values inside each node show the key values stored in that node.

246_figure1.jpg

a) Insert key 13.

b) Based on output from step a), insert key 37.

c) Based on output from step b), insert key 34.

d) Based on output from step c), insert key 45.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91844048
  • Price:- $85

Priced at Now at $85, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Qestion what is your understanding of the term computer

Question: What is your understanding of the term "computer"? Why do we call it computer? Is that what it does? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA ...

An equally weighted portfolio consists of 64 assets which

An equally weighted portfolio consists of 64 assets which all have a standard deviation of 0.276. The average covariance between the assets is 0.106. Compute the standard deviation of this portfolio. Please enter your an ...

A group of students made the following scores on a 10-item

A group of students made the following scores on a 10-item quiz in psychological statistics: {5, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10} What is the variance, treating these scores as a sample?

Video and disruption report assignmentoverviewfor this

Video and Disruption Report Assignment Overview For this assessment task, you will create a two-minute video and written proposal about the impact of a particular technology on an industry or field. The purpose of this a ...

On the below question how did they decided the two

On the below question, how did they decided the two probabilities of guessing the correct and wrong answer on a question? Where did the 0.25 and 0.75 come from? The probability of achieving exactly  k  successes in  n  t ...

Search the internet for information regarding the

Search the Internet for information regarding the interaction between web browser and web server using HTTPS from initial handshake to close of the session. Create a detailed drawing of the steps and also annotate each s ...

Question assignment instructions - 1000 words and at least

Question: Assignment Instructions: - 1000+ words and at least three references other than text - no polemics or personal attacks and avoid the rote repetition of platitudes or dogma - State your hypothesis and then attem ...

Suppose a countrys real gdp is 18 trillion andnbspthat

Suppose a country's real GDP is $18 trillion and that population is 300 million. Instructions:  Enter your answers as whole numbers. a. What is this country's real GDP per capita? $  Suppose that during the next 10 years ...

Explain the two real world examples of database what are

Explain the two real world examples of database. What are they? How do people use them? Discuss at least one situation that would arise from problems in these database, such as redundant information, breach of informatio ...

Sectuon 112 build draw binary search tree with the names

Sectuon 11.2: Build draw binary search tree with the names Doc, Grumpy, Happy, Sleepy, a Bashful, Sneezy, Dopey, inserted in the order provided here. Assume that, on future searche of this tree, each name is equally like ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As