Hmmm...

Nov. 7th, 2001 11:47 am
katster: (Default)
[personal profile] katster
Alright. I see how a binary search works. But how the hell am I supposed to binary search for a number that doesn't exist in my array, but find the closest number...

Hmmm, this is a challenge.

Date: 2001-11-07 12:44 pm (UTC)
From: [identity profile] whitestar2.livejournal.com
Well, a binary search would be in an arranged array, so you have all the numbers in order. So, you search and search and huff and puff, and come up with either one or two numbers. If you have one, that should be it. If you have two, you check 'em.

Date: 2001-11-07 10:27 pm (UTC)
From: [identity profile] katster.livejournal.com
Yeah, I spent this afternoon in assembler playing with the idea, and figured that eventually I come down to an array with two numbers. it's those two numbers I need to check to see which is closer to the number that I want to match.

So yeah, thanks, to you and rob (although he deleted his comment, I'm not sure why). Now it's just translating the idea into assembly code.

-kat

Note

My main blog is kept at retstak.org. I mirror posts to this Dreamwidth account, so feel free to read and comment either here or there.

November 2020

S M T W T F S
1234 567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 18th, 2026 05:58 am
Powered by Dreamwidth Studios