Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
OldAlias
Nov 2, 2013

LP0 ON FIRE posted:

theoretically there's nothing that proves that there could be something faster depending on which you're using for the appropriate case, or was it proven in any use case?

???
https://en.m.wikipedia.org/wiki/Big_Omega_function
???

O is an upper bound, asymptotic less than or equals.
Omega is a lower bound, asymptotic greater than or equals.

There are many ways to go about proving something. Induction is often a good strategy.

OldAlias fucked around with this message at 05:43 on Jun 8, 2017

Adbot
ADBOT LOVES YOU

OldAlias
Nov 2, 2013

ex n log n is the best, worst and expected case of mergesort. so it's often preferred for its consistency and in general sorting can be said to be n log n right. but quicksort or radix sort or a number of others can be faster depending on how your data is structured, or what it is you're ordering. quicksort has a best case of n but can have a worst case of n^2 if the data is mostly ordered or if the pivot is consistently the largest or smallest element. I hope I'm not stating some obvious poo poo, I don't know what your background is

OldAlias
Nov 2, 2013

LP0 ON FIRE posted:

thanks that is good info

it just sounds like to me sorting (or for now) is sort of np because in any case, you need to keep checking to see if you have the correct answer

no. that is accounted for in the algorithm. take a linear walk through sorted data for example, comparing each element to see if the element is greater than the one before. that's at most n operations where n is the size of the input. if you want to know if an algorithm is formally correct beforehand you should read into induction and proofs and symbolic butt's post

e; beaten by cis autodrag

OldAlias fucked around with this message at 22:14 on Jun 7, 2017

OldAlias
Nov 2, 2013

flakeloaf posted:

i'm doing one right now and the book is incomprehensible

cs texts are lol and a racket. unless the material and tests closely follow it find a bunch of other resources as supplement. our course used sedgewick which is worthless for a good portion of the class. he invents his own notation which no one uses because he has problems with Big O - but his problems are addressed with theta and omega, which i guess he never heard of.

visualizations are good (animations, graphs (assuming proper scales) etc) for an intuitive understanding of things. the math you just have to keep hammering at until you recognize patterns and strategies and then everything is almost mechanical

OldAlias fucked around with this message at 19:09 on Jun 9, 2017

OldAlias
Nov 2, 2013

f ~ g. it's basically theta, but if f ~ g then f / g -> 1 (in theta the implied constant is arbitrary)

Adbot
ADBOT LOVES YOU

OldAlias
Nov 2, 2013

if you don't have at least a basic understanding of asymptotic analysis then you're a terrible programmer

  • Locked thread