SunQuest
           Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 7th, 2002, 01:31 AM
sager sager is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 45 sager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Any time bounds on this problem?

The only sollution I could think of was the naive version...
and it has a runtime of O(n^2).

Which isn't a very good upper bound, anyone come up with anything better?

Reply With Quote
  #2  
Old November 7th, 2002, 03:40 AM
sager sager is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 45 sager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Any time bounds on this problem?

On the other hand, 500*500 = 250,000...
Which doesn't really make a difference on any machine that it will run on. Personally, I think you'll see a lot of solutions that solve the problem in the exact same number of steps. Any enlightenment on this issue?

Reply With Quote
  #3  
Old November 7th, 2002, 03:57 AM
diclophis diclophis is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Tampa. FL, USA
Posts: 35 diclophis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to diclophis Send a message via AIM to diclophis Send a message via Yahoo to diclophis
RE: Any time bounds on this problem?

I was thinking about this two, as far as i can tell it shouldnt take more than (2n-3) flips. but to decrease the number of flips would require a more intellegent algorithm, and probably take up extra time proccessing the most optimum flips thus decreasing the number of flips total... but increaseing the time it takes for the script to run. so its a trade off. but if you can figure out a mathmatical way to determine the number of minumum flips without actually running through the flipping of the array i would do that.

Reply With Quote
  #4  
Old November 7th, 2002, 06:42 AM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Any time bounds on this problem?

In some paper I read that there's an algorithm that takes (5n+3)/3 moves, but (unfortunately ;)) I'm not able to find the actual algorithm.

It's worth noting, though, that in many cases, if you do the 2n-3 algorithm (find largest, flip to top, flip to bottom), you'll end up with a solution that's far from being optimal. Even the simple example in the mission statement takes 5 moves, while it's obviously possible to do it in 3. I guess it's similar with the (5n+3)/3 algorithm...

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > Any time bounds on this problem?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway