• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to convert a system input into an array?  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey hello guys good day!
Can anybody help me on creating an array searcher wherein it all depends on the user input. On the first user input it would be the array to search from while the second input would be something to be searched for inside the loop?Thanks any help would be deeply appreciated.
 
Greenhorn
Posts: 3
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find a lot in internet, you have to search for "search algorithm"

http://www.java2novice.com/java-search-algorithms/binary-search/
 
Sheriff
Posts: 4293
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I assume this is some sort of homework or exercise? Because there are better ways to do this than arrays. How about a Map?

If you need to use an array, what about creating a loop through the array? Try that and post the code and we'll go from there.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!