aspose file tools*
The moose likes Programming Diversions and the fly likes Ordering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Ordering" Watch "Ordering" New topic
Author

Ordering

HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
A isn't next to B, C isn't next to D or B. B isn't next to E; neither is C, and D should be left of E.
Can you correctly put these letters in order from left to right ?
You could code a sort algorithm if you so wish.
regards
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Here's my lash at it
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
BDEAC


- Varun
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
BDECA


MH
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
I am assuming you checked your answers.
OK , here's a slight variation.
A isn't next to B, C isn't next to D or B. B isn't next to E; neither is C, and D should be on E's left.
Can you correctly put these letters in order from left to right according to your perspective ?
regards
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
If "D should be on E's left" means to the right of E, when looking at E, then
CAEDB
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Michael, you do realise that you have the beginnings of a program that would work out seating arrangements for a dinner at a diplomatic function ?
Arafat isn't next to Ariel Sharon....
GW Bush isn't next to Bill Clinton .....
(Bush: Are you still President ?
Clinton: The last time I checked, yes!)

Of course you could get away with inserting the wives in between, but you'd also need to know who's wife it is!
Clinton : **** X-rated stuff ******
Hilary : President Clinton, to you, sir!
Clinton : Oh! I thought I remembered you from somewhere !
*****************************************
Cherie : I suffer from the Allerednic syndrome (Cinderella in
reverse, when a capable woman is condemned to a life of
drudgery through marriage).
Tony : Heh! Heh! I am on paternity leave at the moment.
Cherie : Tony, it's time for Little Leo's nappy change.
Tony : Humph! Why do I have to change him ALL the time!
Cherie : 'Cos Carol said it's good for your image.
regards
[ September 20, 2003: Message edited by: HS Thomas ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ordering
 
Similar Threads
operators precedence
Logic with a looping method
Dan's Operator C Exam
mock exam question
how to create a boolean truth table