• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Hat Riddle: Require Java Algorithm  RSS feed

 
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a collection of 5 hats,of different style and colours,A Person goes on Travel,while on Travel he has chose & wear a hat such that the hat is of different style only, and the colour of the hat has to be different/repeated.Write a java algorithm for chosing such a hat ?
 
lowercase baba
Posts: 12628
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deepak Lal wrote:Write a java algorithm for chosing such a hat ?


I would argue there is no such thing as a 'java algorithm'.

algorithms are language neutral. if you have an algorithm, you should be able to implement it in any language.

having said that, I don't even understand the problem. What do you mean 'different style only'? Different from what?

and "the color...has to be different/repeated". again, different from what? and repeated how/when/where?
 
author and jackaroo
Posts: 12195
279
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Crossposted to this StackOverflow topic. Deepak - please read this.
 
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to agree, i can't understand the "problem" from the way it is worded.
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deepak Lal wrote:There is a collection of 5 hats,of different style and colours,A Person goes on Travel,while on Travel he has chose & wear a hat such that the hat is of different style only, and the colour of the hat has to be different/repeated.Write a java algorithm for chosing such a hat ?



my good man , your English is bad. Please use the translation tool from google , and read its result then correct it if necessary , then post it here.

Your question sound interesting , but I cannot fully understand it from your post.

I think java algorithm means and algorithm that is optimized by the use of java - this could be a tricky and fun riddle to solve.
Please post the question again , you made me curious.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!