edit-article
Home
Up
Delete
Article Name:
Article Description:
] big O notation - primer on understanding how to express the relative representation of the complexity of an algorithm
Chapter ID/Name:
Status:
Write
Writing
Written
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">big O notation</h1> <h2>[WHAT]</h2> <ol> <li>] by __ @ __ - </li> </ol> <h2>[WHY]</h2> <ol> <li>] </li> </ol> <h2>[WHERE]</h2> <ol> <li><strong>] READ THE FULL ARTICLE</strong></li> <ol> <li>] <a href="http://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/" target="_blank">A Beginner’s Guide to Big O Notation « Rob Bell</a> - representation of the complexity of an alogithm</li> </ol></ol> <h2>[WHEN]</h2> <ol> <li>] 2017-01-27 EDIT move from contents article</li> </ol> <h2>[EXAMPLE]</h2> <div> <p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; word-wrap: break-word; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;"><strong style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">Big-O notation is a relative representation of the complexity of an algorithm.</strong></p> <p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; word-wrap: break-word; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;">There are some important and deliberately chosen words in that sentence:</p> <ul style="margin: 0px 0px 1em 30px; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; list-style-position: initial; list-style-image: initial; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;"> <li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent; word-wrap: break-word;"><strong style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">relative:</strong> you can only compare apples to apples. You can't compare an algorithm to do arithmetic multiplication to an algorithm that sorts a list of integers. But two algorithms that do arithmetic operations (one multiplication, one addition) will tell you something meaningful;</li> <li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent; word-wrap: break-word;"><strong style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">representation:</strong> Big-O (in its simplest form) reduces the comparison between algorithms to a single variable. That variable is chosen based on observations or assumptions. For example, sorting algorithms are typically compared based on comparison operations (comparing two nodes to determine their relative ordering). This assumes that comparison is expensive. But what if comparison is cheap but swapping is expensive? It changes the comparison; and</li> <li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent; word-wrap: break-word;"><strong style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">complexity:</strong> if it takes me one second to sort 10,000 elements how long will it take me to sort one million? Complexity in this instance is a relative measure to something else.</li> </ul> </div> <h2>[HOW-TO]</h2> <ol> <li>]</li> </ol> <h2>[REFERENCE]</h2> <ol> <li>] <a href="http://stackoverflow.com/questions/487258/plain-english-explanation-of-big-o" target="_blank">http://stackoverflow.com/questions/487258/plain-english-explanation-of-big-o</a> </li> </ol> <h1 style="text-align: center;"> </h1>