Highlights
Identify which algorithm has which big-Oh running time and explain your answer.
1.2) Calculate big-Oh running time, in terms of n, of the algorithm D shown below:
Algorithm D (n) {
s = 0; for i = 1 to n -1,
for j = n downto 1 in steps j = j / 2,
s = s + i*j; return s; }
Task: 2
Algorithm Design
Let E = {e1, e2, ..., en} be a sequence of integers. We say that an integer x forms a majority in E if x appears more than floor(n/2) times in E. For instance, the integer 3 is a majority in sequence E = {2, 3, 3, 2, 3, 3}, whereas the sequence E = {6, 3, 2, 7, 3, 1} has no majority.
Assume that for each i, we have 1 ? ei ? k, where k is an integer. Describe an algorithm, with O(n + k) running time, which decides if E has a majority.
Task: 3
Master Theorem
Using the Master theorem, find the running time (Big-O) of the following algorithms:
3.1) Merge sort is a classical recursive divide-and-conquer algorithm for sorting an array. The algorithm splits the array in half, recursively sorts the two halves, and then merges the two sorted sub-arrays into the final sorted array. Time taken for the algorithm can be denoted as:
This DAT600: Engineering Assignment has been solved by our Engineering experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.