Click here to Skip to main content
15,896,912 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Distributing (different sized) objects Pin
Wjousts16-Jul-10 5:40
Wjousts16-Jul-10 5:40 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 5:50
Alan Balkany16-Jul-10 5:50 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 3:31
Wjousts20-Jul-10 3:31 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 7:56
Wjousts20-Jul-10 7:56 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany20-Jul-10 8:01
Alan Balkany20-Jul-10 8:01 
AnswerRe: Distributing (different sized) objects Pin
Luc Pattyn16-Jul-10 5:54
sitebuilderLuc Pattyn16-Jul-10 5:54 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 6:06
Alan Balkany16-Jul-10 6:06 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 3:30
Wjousts20-Jul-10 3:30 
I'm trying to implement functionality very similar to what PowerPoint does.
Example:

- Open PowerPoint
- On a blank slide, throw a bunch of boxes on the slide.
- Select several boxes.
- (In PowerPoint 2003, probably different in newer versions)Click Draw on the toolbar at the bottom, select "Align or Distribute" -> "Distribute Horizontally"

So, if you start with this (collapsing everything to one dimension for clarity):

....[A].....[B].....[C]..[D]...


You end up with this:
....[A]....[B]....[C]....[D]...


This is fairly trivial if all the boxes are the same size, but when they are different sizes, it gets a bit trickier (adding a second dimension only to make overlaps clearer - it's still a 1D problem):

.......[...B...]............[D]...
....[.A.]............[..C..]......


Should give:
..........[...B...].........[D]...
....[.A.]...........[..C..].......

GeneralRe: Distributing (different sized) objects Pin
Luc Pattyn20-Jul-10 8:11
sitebuilderLuc Pattyn20-Jul-10 8:11 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 9:14
Wjousts20-Jul-10 9:14 
GeneralRe: Distributing (different sized) objects Pin
Luc Pattyn20-Jul-10 9:38
sitebuilderLuc Pattyn20-Jul-10 9:38 
QuestionGetting all combinations of N sets of objects iteratively Pin
gantww11-Jul-10 15:58
gantww11-Jul-10 15:58 
AnswerRe: Getting all combinations of N sets of objects iteratively Pin
Alan Balkany15-Jul-10 3:55
Alan Balkany15-Jul-10 3:55 
QuestionMy sorting algorithm Pin
AksharRoop6-Jul-10 4:53
AksharRoop6-Jul-10 4:53 
AnswerRe: My sorting algorithm Pin
Luc Pattyn6-Jul-10 5:20
sitebuilderLuc Pattyn6-Jul-10 5:20 
GeneralRe: My sorting algorithm Pin
AksharRoop6-Jul-10 5:24
AksharRoop6-Jul-10 5:24 
GeneralRe: My sorting algorithm Pin
RugbyLeague6-Jul-10 22:41
RugbyLeague6-Jul-10 22:41 
GeneralRe: My sorting algorithm Pin
molesworth7-Jul-10 1:33
molesworth7-Jul-10 1:33 
GeneralRe: My sorting algorithm Pin
RugbyLeague7-Jul-10 2:37
RugbyLeague7-Jul-10 2:37 
QuestionCounting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 4:51
Tadeusz Westawic24-Jun-10 4:51 
AnswerRe: Counting set bits in bitmap [modified] Pin
harold aptroot24-Jun-10 5:14
harold aptroot24-Jun-10 5:14 
GeneralRe: Counting set bits in bitmap [modified] Pin
Tadeusz Westawic24-Jun-10 6:07
Tadeusz Westawic24-Jun-10 6:07 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 6:19
harold aptroot24-Jun-10 6:19 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 7:01
harold aptroot24-Jun-10 7:01 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 7:46
Tadeusz Westawic24-Jun-10 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.