FIT1045 Lecture Notes - Lecture 11: Big O Notation, Binary Tree

139 views1 pages
WEEK 11 - COMPLEXITY
Complexity
Factors that affect Running Time:
If list is small, running time will be short, vice versa
Present at the start list, small running time,
The less powerful machine, running time will be longer
Analyse algorithm by time complexity when there are factors you cannot
control
RAM:
‘Simple’ operation will take one time unit
Read, print and return will take one time unit
Comparing 2 values one time unit
Several statements will be the sum of statements
Big O notation:
Why do we use it?
Order = find the dominant of the function
Highest growth rate
We ignore the constant numbers (eg. 100 N^2, Big O = O(N^2)
If used on small inputs, the growth rate of the running time may be less
important than other factors
Height = max level in the graph
Balanced Binary Tree
Height of left subtree - height of right subtree is greater or equal to 1
Unbalanced Binary Tree
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.

Already have an account? Log in

Document Summary

If list is small, running time will be short, vice versa. Present at the start list, small running time, The less powerful machine, running time will be longer. Analyse algorithm by time complexity when there are factors you cannot control. Read, print and return will take one time unit. Several statements will be the sum of statements. Order = find the dominant of the function. We ignore the constant numbers (eg. 100 n^2, big o = o(n^2) If used on small inputs, the growth rate of the running time may be less important than other factors. Height of left subtree - height of right subtree is greater or equal to 1.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents