Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ordering

 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my lash at it
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BDEAC
 
Arjun Shastry
Ranch Hand
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BDECA
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If "D should be on E's left" means to the right of E, when looking at E, then
CAEDB
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic