Yeah, I was wondering about that.
The i loop makes the j loop run i times, where i is going to be equal to n + (n-1) + (n-2) + ... + 1 times. In turn, each run of the j loop makes the k loop run i the same number of times. The loop at the bottom for moving the array members around should run on average n/2 times; it's not important, right? So, really you're looking at (n + (n-1) + (n-2) + ... + 1)^2. Yes...?
--\r\n-------------------------------------------------------------------\r\n* Jack Troughton jake at consultron.ca *\r\n* [link|http://consultron.ca|http://consultron.ca] [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\r\n* Kingston Ontario Canada [link|news://news.consultron.ca|news://news.consultron.ca] *\r\n-------------------------------------------------------------------
Edited by
jake123
March 27, 2003, 03:30:15 PM EST