It's UWAweek 47

help2200

This forum is provided to promote discussion amongst students enrolled in CITS2200 Data Structures and Algorithms.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 3 articles in this topic
Showing 3 of 176 articles.
Currently 12 other people reading this forum.


 UWA week 15 (1st semester, week 6) ↓
SVG not supported

Login to reply

👍?
helpful
12:45pm Fri 12th Apr, ANONYMOUS

For the first question. D is correct right? Since we are comparing Big O notation. Thought I'd just double check, thank you!



This article has 1 attachment:

 

SVG not supported

Login to reply

👍x2
helpful
11:59pm Fri 12th Apr, ANONYMOUS

No, the answer is A. "f(n) is O(g(n))" basically means the graph of f(n) will be bounded by the graph of g(n) at some point, and multiplied by some constant factor. And the notation is confusing because it's "=", but think of it as "<=" so O(n) = O(n^2) is true. so is O(n) = O(n^2) and O(n) = O(n^1000) or O(n) = O(2^n). Just like 1 < 2, and 1 < 4, 1 < 1000. Using the definition: O(nlogn) = O(n^2). We need to find c and n0 satisfying: f(n) <= cg(n) for n > n0. in our case nlogn <= cn^2 [for n > n0] take c = 1 and n0 = 10: nlogn <= 1n^2 Which is true, when n > 10, this above will always be true.


SVG not supported

Login to reply

👍?
helpful
11:10am Sat 13th Apr, ANONYMOUS

Thank you so much! Was pretty confused, guess its just how the question is written. Thank you for clarifying

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy