home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16642 < prev    next >
Encoding:
Text File  |  1992-11-17  |  830 b   |  29 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: Search function algorithms
  5. Message-ID: <BxuLM0.MF9@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <102274@bu.edu>
  9. Distribution: comp
  10. Date: Tue, 17 Nov 1992 06:49:11 GMT
  11. Lines: 16
  12.  
  13. corvett@cs.bu.edu (Sungyeup Kim) writes:
  14. : Hi, 
  15. : Could somebody give me a very nice and easy search algorithm. 
  16. : What I want to do is after I get a string(I don't know the length) 
  17. : I want to check whether it's in the array or not.
  18. : Thanks in advance !!!
  19.  
  20. Easy. bsearch() c library function will do it. If your array isn't
  21. sorted before the call, use qsort(). Both are documented in reference
  22. books, work easily, and quickly.
  23.  
  24. Dave Fuller
  25. dfuller@portal.hq.videocart.com
  26.  
  27.