This content has been marked as final.
Show 2 replies

1. Re: General Algorithm Question
843853 Dec 15, 2009 2:33 PM (in response to 843853)compSciUndergrad wrote:
There's a specific forum for general algorithm questions. So it's OK that you asked it, but here's not the place.
This is a general programming algorithm question opposed to specifc java based but i hope you can help
so basically back to the question, how can the 2 be compared for situations where 1 is betetr than the other or where there is a case that the 2 may not differ tooo much from each other
It sounds like you just did. Are you being asked for something more qualitative? You can start by identifying the worst and best case complexities for each algorithm, and when they occur (for example, Quicksort is on average O(n log n) but has a worstcase complexity of O(n^2) which can be encountered if you don't randomize the pivots and the list is already sorted).
Perhaps what you need to do is prove it inductively? As in, for all graphs of N nodes and K or more edges, Prim's is better. But it seems like such a proof would require such a precise set of circumstances that it would be hard to generalize into an inductive proof. 
2. This Thread is now moved
843853 Dec 15, 2009 2:36 PM (in response to 843853)Note: This thread was originally posted in the [New To Javahttp://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.