This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sequential Search  RSS feed

 
Mark Andy
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to do a sequential search & binary of a data file and key file. I took some hints from class and put it together. Now I'm stuck on how to actually run the sequential search for the two files. Any push forward would help!
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i understand correctly, you want to do sequential and binary search on the file, is it right?

Also if yes, then what do you want to search in the file? A word, line or a character. What have you done in linear search
is stored each character in an array and search then individual character.

In binary search, you start searching on the same array but binary search works on sorted input. You need to sort first
before using binary search.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!