COMP.4040 Analysis of Algorithms Assignment

Assignment Help Computer Engineering
Reference no: EM133116101

COMP.4040 Analysis of Algorithms - University of Massachusetts Lowell

Question 1: Suppose that we have numbers between 1 and 1000 in a binary search tree, and we want to search for the number 363. Which of the following sequences could not be the sequence of nodes examined? Justify.
(a)2, 252, 401, 398, 330, 344, 397, 363.
(b)924, 220, 911, 244, 898, 258, 362, 363.
(c)925, 202, 911, 240, 912, 245, 363.
(d)2, 399, 387, 219, 266, 382, 381, 278, 363.
(e)935, 278, 347, 621, 299, 392, 358, 363.

Question 2: The lowest common ancestor of two nodes v1 and v2 (denoted by LCA(v1, v2)) of a rooted tree that has both v1 and v2 as descendants.
(a) Write pseudocode that computes LCA (v1, v2) in a given BST T .
(b) What is the time-complexity of your algorithm? Give the time complexity as a function of n = |T | and of h, the height of T .

Question 3: Given a binary tree T give a simple algorithm to check whether T is a BST. Try to use functions already de ned in class. Argue correctness with one or two sentences. What is the time complexity?

Question 4: Show the BST obtained by successively inserting the keys 45, 38, 31, 41, 12, 39, 40, 42 into an initially empty BST. Then, show the resulting BST after deleting 38.

Question 5: Show the red-black trees that result after successively inserting the keys 41, 38, 31, 12, 19, 8 into an initially empty red-black tree.

Question 6: You are given a red-black tree, T, and some value v (not contained in T ). You must split T into two red-black trees, such that one contains all values less than v, and the other contains all values greater than v.

Try to get logarithmic time, but if you can get anything sub-linear, that's also good.

Reference no: EM133116101

Questions Cloud

Design software application : You have been requested to design a software application for a large toy company that provides an online product catalog for ordering all types of toys and game
Discuss the goal of family-owned public listed corporations : Discuss if the goal of family-owned public listed corporations is similar to those of corporations at large. How might agency conflicts arise in family-owned co
Explain the current annual cost of university : An investor plans to pay his son's university tuition fees for 4 years starting 18 years from now. The current annual cost of university is £9,200, and they exp
Identify your career objectives : The purpose of the reflection paper is to identify your career objectives, summarize how the MSIS program has helped you achieve those objectives
COMP.4040 Analysis of Algorithms Assignment : COMP.4040 Analysis of Algorithms Assignment Help and Solution, University of Massachusetts Lowell - Assessment Writing Service
Forensic investigation : How can it be used to question the conclusions drawn from a forensic investigation?
Why the market cap weighted index is more popular : Briefly explain why the market cap weighted index is more popular as a replication portfolio compared to an equally weighted index.
Exchange rate between myr and gbp : How Covid-19 pandemic affect the exchange rate between MYR and GBP.
Develop computer and internet security policy : You have been hired as the CSO (Chief Security Officer) for an organization. Your job is to develop a computer and internet security policy

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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