Article View: comp.os.ms-windows.programmer.tools.owl
Article #6Searching in a sorted array
From: Guy Naor
Date: Mon, 02 Oct 1995 22:17
Date: Mon, 02 Oct 1995 22:17
16 lines
807 bytes
807 bytes
Hi!!! I'm looking for the best (fastest) way for finding the first occurence of a string in a sorted array, when entries aren't unique. For example: an array containing: AA,AB,AC,AD,BB,BB,BB,BC,BF,CG,CG,CT I want to find the first occurance of BB. A binary search will stop on the middle BB, and will require a backward serial search to find the first BB. Is there a good algorithm for this? Bye, Guy.
Technical Details
Message-ID:
<44prsv$ki7@news.netvision.net.il>Path:
arc1-ca.pugleaf.net!news.netvision.net.il!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.netvision.net.il!usenet From: galor@netvision.net.il (Guy Naor) Newsgroups: comp.os.ms-windows.programmer.tools.owl,comp.lang.c++ Subject: Searching in a sorted array Date: Mon, 02 Oct 1995 22:17:14 GMT Organization: NetVision LTD. Message-ID: <44prsv$ki7@news.netvision.net.il> NNTP-Posting-Host: ts36p16.netvision.net.il X-Newsreader: Forte Free Agent 1.0.82