\$20 Bonus + 25% OFF

# COMP90038 Algorithms And Complexity

0 Download7 Pages / 1,595 Words Add in library Click this icon and make it bookmark in your library to refer it later. GOT IT

## Questions:

### Objectives

To improve your understanding of data structures and algorithms for sorting and search. To consolidate your knowledge of trees and tree-based algorithms. To develop problem-solving and design skills. To develop skills in analysis and formal reasoning about complex concepts. To improve written communication skills; in particular the ability to use pseudo-code and present algorithms clearly, precisely and unambiguously.

### Problems

1. Consider the data sequence S = [82; 91; 13; 92; 64; 10; 28; 55; 96; 97]. Draw a valid AVL tree for it, assuming that the data has arrived one at the time. Show detailed steps by giving the AVL tree after inserting each element.
1. Consider two sets of integers, X = [x1; x2; : : : ; xn] and Y = [y1; y2; : : : ; yn]. Write two versions of a FindSetIntersection(X; Y ) algorithm to nd the common elements in both sets. Each of your algorithms should return an array with the common elements, or an empty array if there are no common elements.

You may make use of any algorithm introduced in the lectures to help you develop your solution. That is, you do not have to write the ‘standard’ algorithms { just use them. Therefore, you should be able to write each algorithm in about 10 lines of code. You must include appropriate comments in your pseudocode.

• Write a pre-sorting based algorithm of FindSetIntersection(X; Y ). Your algorithm should strictly run in O (n log n).
• Write a Hashing based algorithm of FindSetIntersection(X; Y ). Your algorithm should run in O (n).
1. Sloppy Inc. has a very unusual way to communicate the decisions made by its CEO to all employees. Each day, any employee that knows the decision can disclose it to at most one of its direct subordinates. Design an e cient algorithm to compute the minimum number of days required for the decision to be disclosed to all employees. What is the time complexity of your algorithm?

To help you design your algorithm, assume that Sloppy Inc. has a hierarchical structure resembling an n-ary tree. Each employee is labeled f0; 1; : : : ; n 1g, where 0 corresponds to root of the tree (the CEO). To store the tree you can use a two-dimensional array C [n] [n], where k = C [i] [0] is the number of direct subordinates of employee i, and C [i] [1 : : : k] contains the labels of each direct subordinate employee. Any other entry in the array has value of 1. Note that the order in which the messages are distributed matters, e.g., employees with deeper subordinate trees should probably receive the message rst.

1. Given an array of n numbers A [0 : : : n 1]. Write an e  cient algorithm for below cases:

(a) For each of the element A [i], fifind the minimum j so that A [j] > A [i] and j > i. Your algorithm should return an array of length n. If such j does not exist for some i, that entry should be -1. What is the complexity of your algorithm?

(b) For each of the element A [i], fifind the minimum A [j] so that A [j] > A [i] and j > i. Your algorithm should return an array of length n. If such j does not exist for some i, that entry should be -1. Your algorithm should have O (n log n) complexity.

To help you verify your algorithm, for the sequence [80; 19; 49; 45; 65; 71; 76; 28; 68; 66] the results are:

### Cite This Work

My Assignment Help (2021) Algorithms And Complexity [Online]. Available from: https://myassignmenthelp.com/free-samples/comp90038-algorithms-and-complexity/understanding-of-data-structures.html
[Accessed 11 April 2021].

My Assignment Help. 'Algorithms And Complexity' (My Assignment Help, 2021) <https://myassignmenthelp.com/free-samples/comp90038-algorithms-and-complexity/understanding-of-data-structures.html> accessed 11 April 2021.

My Assignment Help. Algorithms And Complexity [Internet]. My Assignment Help. 2021 [cited 11 April 2021]. Available from: https://myassignmenthelp.com/free-samples/comp90038-algorithms-and-complexity/understanding-of-data-structures.html.

### Latest Statistics Samples

Answer: Case 1 ANOVA is the technique that is used to evaluate whether the results obtained from a survey is significant. The differences in the average of the values in more than two groups are estimated with the help of this technique. In this case, 35 students have given ratings to four professors. It is to be tested which professor is the nest of the four based on the ratings given by the students. Thus, in order to evaluate that, it is ...

#### MGMT2050 Statistics

Answer: Scatter plot has been used to show the relationship between the variable age and Injury Severity Score is highlighted below. Age: Age of patients does not depend on other factors and is an independent event and therefore, age would be considered as independent variable. Injury Severity Score: This depends on age and therefore, Injury Severity Score (ISS) would be considered as dependent variable. Part b Regression model Age: Ind...

#### HI6007 Statistics For Business Decision

Answer: Examination scores                             52                             63                             92 Classes Frequency  Cumulative Frequency  ...

#### BUS 302 Business Statistics II

Answer: Introduction This paper presents statistics for the top 20 richest countries in the world in terms of the real GDP per capita. Real GDP Per capita refers to a measure of the total output of a country that takes the gross domestic product (GDP) and divides it by the number of people in that country (Dharmapala & Hines, 2009). This measure is useful and important when it comes to comparing countries since it sows the relative perfor...

#### MAN4011 Introduction To Entrepreneurship

Answer: Discussion The ANOVA test helps in finding out the significant difference between the grouped means in a statistical manner. It can be seen that the value of p=.004, which is less than 0.05. This shows that there is a statistical significance between the well-being of the Turkish migrants in London with respect to self-efficacy, finance, language and culture. From the coefficient table it can be stated that the total p value for self...

Next

### Save Time & improve Grade

Just share requirement and get customized Solution.

Orders

Overall Rating

Experts

### Our Amazing Features

#### On Time Delivery

Our writers make sure that all orders are submitted, prior to the deadline.

#### Plagiarism Free Work

Using reliable plagiarism detection software, Turnitin.com.We only provide customized 100 percent original papers.

#### 24 X 7 Live Help

Feel free to contact our assignment writing services any time via phone, email or live chat. If you are unable to calculate word count online, ask our customer executives.

#### Services For All Subjects

Our writers can provide you professional writing assistance on any subject at any level.

#### Best Price Guarantee

Our best price guarantee ensures that the features we offer cannot be matched by any of the competitors.

### Our Experts

5/5

1692 Order Completed

98% Response Time

### Alfred Dodd

#### Wellington, New Zealand

5/5

1265 Order Completed

97% Response Time

### James Cook

#### Wellington, New Zealand

5/5

610 Order Completed

100% Response Time

### Cheryl Zhao

#### Singapore, Singapore

5/5

647 Order Completed

98% Response Time

### FREE Tools

#### Plagiarism Checker

Get all your documents checked for plagiarism or duplicacy with us.

#### Essay Typer

Get different kinds of essays typed in minutes with clicks.

#### Chemical Equation Balancer

Balance any chemical equation in minutes just by entering the formula.

#### Word Counter & Page Calculator

Calculate the number of words and number of pages of all your academic documents.

## Refer Just 5 Friends to Earn More than \$2000

1

1

1

### Live Review

Our Mission Client Satisfaction

Omg they’re doing very good I got 100 from 100 ???? thank you so much for your help you saved me

#### User Id: 534789 - 10 Apr 2021

Australia

the writer did a good job but live chat is not working for my exam, so it waste some time

#### User Id: 663960 - 10 Apr 2021

Australia

This solutions has been escalated & reworked 4 time, and has cause me lots of delays and time to submitting my final work to my professor. I hope this does not happen again. I am your regular and loyal customer, please do not do this again. I am ...

#### User Id: 333156 - 10 Apr 2021

Australia

Excellent work ..I will keep in touch with my future work. Really appreciate all your effort . So far so good. thanks again.

Australia

## Order on the go!

Say hello to our new app