How Binary Search Makes Computers Much, Much Faster

  • čas přidán Před 6 měsíci

    Tom Scott

    doba trvání: 06:51

    Featuring binary versus linear search, and non-clustered indexes. Uh, indices. However you want to say it. • MORE BASICS: cscodes.info/level/PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
    Written with Sean Elliott SeanMElliott/ • Camera by Tomek • Graphics by William Marler wmad.co.uk
    I'm at tomscott.com
    on Twitter at tomscott
    on Facebook at tomscott
    and on Instagram as tomscottgo

Tom Scott
Tom Scott

I am, as ever, extremely thankful for animator William Marler for handling all the graphics here!

Před 8 měsíci
BrewDiePie
BrewDiePie

Information. I.e books, are mostly changing with the 3-5year paradigm. So why not sort by release date?

Před měsícem
Maty Lojda
Maty Lojda

Hmm video is uploaded a month ago, but Tom written this comment 3 months ago? Wierd

Před 4 měsíci
Dennis Bautembach
Dennis Bautembach

how can there be a 3-month old comment on a video uploaded 2 months ago?

Před 5 měsíci
Joshua Murillo
Joshua Murillo

This video is great, as per usual, but it's particularly awesome that you added that bit about Dewey. This is what needs to happen, an extra 10s to give context, not much, but so worth the time. Thanks

Před 5 měsíci
Dan Mahoney
Dan Mahoney

A113, eh?

Před 6 měsíci
G
G

The search function in Windows is a different type of cluster :-D:-D:-D

Před dnem
Bluey
Bluey

i don't like the echo

Před 3 dny
Espada
Espada

It always makes me laugh when a leftist calls people from 100 years ago terrible people, sorry they didn't have mass brainwashing back then and they weren't domesticated like the people of today.

Před 4 dny
canasta
canasta

The Dewey decimal system... what a scam that was.

Před 5 dny
Shadow
Shadow

The fastest sorting method is the one that randomly shuffles your list until it’s in order

Před 5 dny
ike
ike

Yep, I only index most folders on my C: drive in windows, its the only drive I search weekly and its also the one with the most individual files of different types. My other drives are all larger less files, usually in subfolders so my brain can find them with 2 clicks on average My game drives have many files but I dont do many searches for "fractal.pak" haha

Před 5 dny
SkellyMinecraft
SkellyMinecraft

I thought 13 was unlucky?

Před 7 dny
Alexander Kurt
Alexander Kurt

4:21 Don’t tell me that screen has T-Series on it

Před 12 dny
bybeetho
bybeetho

*Wow, Very good. ... Muito bom. ... Très bien. ... Beetho, da "Boomerang Flowers Band ®", de Belo Horizonte (MG), Brasil.*

Před 12 dny
GH1618
GH1618

Now do one on the B-tree.

Před 13 dny
Tryaz EVE
Tryaz EVE

I don't know why you felt that you had to denounce Dewey... weird

Před 13 dny
nosuchthing8
nosuchthing8

It's simple. Would you look for a phone number in a phone book starting at page one, and reading every single page until you find the name? No. You break the phone book in half, see which half the name is in then keep repeating.

Před 14 dny
Matthew Poynter
Matthew Poynter

Real OGs get the curious George reference

Před 14 dny
Fridays For Future
Fridays For Future

On a smaller scale linear search is often faster because of cpu pipelines

Před 14 dny
Mystical Apple
Mystical Apple

0:19 The attention to detail here is incredible. Besides the obvious joke about Tom’s red shirts, John Scalzi is an actual author that wrote a book called _Redshirts_

Před 15 dny
nonfictionalfictivename fictivname
nonfictionalfictivename fictivname

Binar search is used just for ordered list not unordered

Před 16 dny
Roger Szmodis
Roger Szmodis

Pathetic human race. Arranging their knowledge by category just made it easier to absorb. Dewey, you fool! Your decimal system has played right into my hands!

Před 16 dny
Steve A
Steve A

Brilliant !!!! 👍🏻👌🏻👍🏻👌🏻

Před 17 dny
Christian Nicolaisen
Christian Nicolaisen

Doesn't databases typically use balanced trees, not binary ones? They are very much related, but balanced trees takes makes sure sorted input doesn't result in a lopsided tree. They also uses the fact that data is usually bunched together in storage medias.

Před 17 dny
Perhaps
Perhaps

Aside from the design of google's indexes, the reason that their searches are so fast is because they store 100% of their indexes in RAM -- and very fast RAM on very fast computers. They build their indexes off-line. Once built, they copy them to one of their RAM-based index servers. Once copied there, they then add that index server to their client pool. it is the computers in the client pool that we interact with when we make a search request (not directly, because we go through firewalls and load balancers -- but our search requests hit those RAM index servers). So people making search requests never see the work, and delays, behind the scenes, that go into creating the indexes. We are simply given access to those indexes, when someone at google adds a now-ready RAM index server to their pool of computers that process our requests.

Před 18 dny
Riley Carpenter
Riley Carpenter

Content

Před 21 dnem
Google User
Google User

Same as genders, if you treat it as binary, you can advance society much much faster

Před 23 dny
MikeyMonkey
MikeyMonkey

Things I learned today: How binary searches work. Dewey was a terrible human being.

Před 24 dny
Paul
Paul

Don't recommend WhatsApp.

Před 24 dny
Michael Roditis
Michael Roditis

Laughing in hashmap

Před 26 dny
Ryansleftboot
Ryansleftboot

Tom, I do not know how you find the time and effort to produce these videos but they are brilliant! Top one. Nice one. Get sorted.

Před měsícem
Joel Varghese
Joel Varghese

Missive respect to google for optimizing the algorithm I wish it was open source.

Před měsícem
Winston Smith
Winston Smith

Girls eyes

Před měsícem
Robert Martin
Robert Martin

I don't disagree with any of Tom's criticisms of the man's moral failures, but hearing a guy like Tom complain about how evil a historical figure was makes me want to die a little bit.

Před měsícem
Weeping Angel
Weeping Angel

All the schools and libraries I’ve been to still use dewey’s system for nonfiction

Před měsícem
Senthil Kumar Palanisamy
Senthil Kumar Palanisamy

Excellent explanation Tom, I never found one like this on binary search in youtube. Thanks for the content

Před měsícem
Zaid Lacksalastname
Zaid Lacksalastname

smart guy from the past starter pack: Eugenics prof That's it

Před měsícem
Dar Brett
Dar Brett

Don't you hate it when you notice Tom Scott say you can't do something, and you say to yourself "Wrong! You can use multiple indices and there should be a tiny overlap, if any, to sort through after" and then Tom says "Unless you uses indexes" and it makes your entire train of thought redundant.

Před měsícem
Dan Duncker
Dan Duncker

Still Google search isn't perfect

Před měsícem
KeyStroke
KeyStroke

What kind of computers are those next to you? They look just like the ones I used at the phone company from 1998-2002ish (when we finally got color monitors.)

Před měsícem
LANBros
LANBros

The tame robert epidemiologically rot because headlight hisologically untidy down a broad tights. utopian, encouraging sail

Před měsícem
Tano
Tano

BIG TO SMOL

Před měsícem
guywithknife
guywithknife

“It doesn’t make much difference for eleven cards”, if anything it actually makes searching small datasets slower than linear search since linear search is cache and prefetch friendly while binary search is not. You need enough items in the dataset so that the search time is dominated by the items rather than cache thrashing.

Před měsícem
BrewDiePie
BrewDiePie

Information. I.e books, are mostly changing with the 3-5year paradigm. So why not sort by release date?

Před měsícem
David Clift
David Clift

Well seven months later the search take longer but returns 100,000,000 more results!!

Před měsícem
KingPatrick 12
KingPatrick 12

God I'd love to talk with Tom.

Před měsícem
Pigman Rocker
Pigman Rocker

Sorting by colour is psychopathic and stupid. You cant change my mind. It doesnt make sense. Breaks as soon as a series has different colours.

Před měsícem
Michael Watts
Michael Watts

4:02 genuinely expecting Tom to say “a cluster ****” 😂

Před měsícem
Draqonboy
Draqonboy

Can we point out how great the "The Basics" sound is?

Před měsícem
Joseph Cohen
Joseph Cohen

Goes to show terrible people can still have good ideas

Před měsícem
Bruno Oliveira
Bruno Oliveira

When I selected the video, I didn't know what was going to be about. And suddenly I remembered every time i had to access data from an SQL table. The term "did you put an index in that table" was say out loud every time a process was taking to long.

Před měsícem
Ana Ibrahim
Ana Ibrahim

this is what we call it a video thanks so much for the efforts

Před 2 měsíci
c182SkylaneRG
c182SkylaneRG

Another thing to remember: make sure your computer isn't programmed to index the index. I was wondering why my index file was 263 GB on my 500 GB hard drive, and someone told me to make sure the index was excluded from itself. Whoops! :)

Před 2 měsíci
Igor Patricio
Igor Patricio

I like the way you explains me things like I was an 3 years old baby with defunctional brain, so I can understand everything

Před 2 měsíci
Buba Vunga
Buba Vunga

0:18 this looks like a book Tom would read

Před 2 měsíci
Hazim ABDELGADIR OMAR
Hazim ABDELGADIR OMAR

Truely great information.

Před 2 měsíci
Josef Thörn
Josef Thörn

Dewey - The Andy Rubin of his time...

Před 2 měsíci
Fat Fuck
Fat Fuck

Dewey is a fantastic example of an uncomfortable truth. Sometimes terrible people can do great things.

Před 2 měsíci
Sacha Scarabello
Sacha Scarabello

mmmmMMMmM bogos binted

Před 2 měsíci
lennyp18
lennyp18

Nice tip of the hat using A113!

Před 2 měsíci
urkerab
urkerab

It's quite simple: Database indexes contain the indices of the data, but in a different order, so you can quickly search the index to find the index of the original data you wanted.

Před 2 měsíci
James TSY
James TSY

Chinese dictionaries also have indexing by radicals, on top of the stroke count and pages. Radicals are memorable visual components of many Chinese characters, and often carry a unified meaning to characters who share them, e.g. characters with 亻are usually human-related, or characters with 氵are usually water-related. Certainly has more meaning as an index than colour (to me), though ofc not all indexes need a deeper meaning anyway, as long as they get the job done....

Před 3 měsíci
Joe dlvr
Joe dlvr

Oh wow when i got taught about this in school i didnt think dewey was a sexpest

Před 3 měsíci
CookingAndJava
CookingAndJava

linear search is very often faster than binary search because of cache prefetching.

Před 3 měsíci
Nora
Nora

Oh, this video gave me a big wave of high school flashbacks. That sequence of cards really brings back memories, haha.

Před 3 měsíci
Jounan
Jounan

Wow, Dewey seems like a cool gu-... oh god..

Před 3 měsíci
ScorixEar
ScorixEar

*Indexes Indizes = multiple registers Indexes = multiple indexes in a database Tought by my university professor in Germany

Před 3 měsíci
jon pazowski
jon pazowski

who says sexsism and rasism is bad, it can be an indication of wrong that is ignored by some like you apparenty

Před 3 měsíci
Jonas Antonsson
Jonas Antonsson

Well, you normally use a hash table for the primary key index, not rely on binary search for that. Binary search is common for other indexes though.

Před 3 měsíci
sagacious03
sagacious03

Neat video! Thanks for uploading!

Před 3 měsíci
Styil
Styil

>there are two ways a computer can search, linear or binary Laughs in hashmap

Před 3 měsíci
Joel Murphy
Joel Murphy

pedobyte (n.) the amount of data storage used by the average nonce.

Před 4 měsíci
Blair the cat
Blair the cat

That’s some GREAT green screen

Před 4 měsíci
Gaurav Kar
Gaurav Kar

If life is a Search for Meaning it better be Binary Search

Před 4 měsíci
Jorge Martínez Blanco
Jorge Martínez Blanco

A113 easter egg on a Tom Scott Video? More likely than you think.

Před 4 měsíci
YourBoiAbdo
YourBoiAbdo

2:01 HP: 1000 T-SERIES anyone notice this? i thought it was just a mistake but nevermind.

Před 4 měsíci
RussetPotatoe
RussetPotatoe

I always have to use linear search, it's because I'm non binary

Před 4 měsíci
Zombie
Zombie

T-Series easter egg? 2:00

Před 4 měsíci
Mr. Hat
Mr. Hat

What

Před 4 měsíci
januzi2
januzi2

5:36 I'm using the triangle to describe the struggle between CPU, ram, and disk space. The size of the triangle is showing the size of the impact on the system that the program will have.

Před 4 měsíci
AbyssOf _Saints
AbyssOf _Saints

But Wiggle Ferret

Před 4 měsíci
Cactus
Cactus

Dewey based system lmao cry harder about it and NYW

Před 4 měsíci
Gerwin Kiesinger
Gerwin Kiesinger

life is about 3 things, getting bitches, getting money, and the dewey decimal system - Bo Burnham

Před 4 měsíci
Weldeborn
Weldeborn

How can anyone dislike a video like this? Great work as always!

Před 4 měsíci
Hjominbonrun
Hjominbonrun

nicely described.

Před 4 měsíci
B Things
B Things

*Indexing:* Do you want to be lazy now or in the future?

Před 4 měsíci
Brian Kelly
Brian Kelly

Can you use this on Microsoft folder sorting?

Před 4 měsíci
Ariel Almeida
Ariel Almeida

Amazing

Před 4 měsíci
Simon Humby
Simon Humby

Yet Windows takes forever to search my computer?

Před 4 měsíci
Mystic-Malevolence
Mystic-Malevolence

Most likely windows explorer is set to search file contents as well--if you turn that off, it'll only search filenames, which is far quicker.

Před 13 dny
ılılıᴘᴀʟᴇʙʟᴜᴇᴅᴏᴛɢᴜʏılılı
ılılıᴘᴀʟᴇʙʟᴜᴇᴅᴏᴛɢᴜʏılılı

Great to see matt parker in a tom scott video

Před 4 měsíci
TheMightyKinkle
TheMightyKinkle

I'm interested in Dewey's sexual deviences now

Před 4 měsíci
Khunark
Khunark

long live racism! you will never silence the truth!

Před 4 měsíci
Mr. Hat
Mr. Hat

Great joke

Před 4 měsíci
Michal Nemecek
Michal Nemecek

Thanks to Melvil Dewey we don't need to ask the librarian where a specific adult book is.

Před 4 měsíci
Luke Gibson
Luke Gibson

I don't know how they do it, but I've got a search program that requires no indexing and is able to return over 2 million results across 4.68TB of data, in 5.63 seconds. Ultra Search, it's free too.

Před 4 měsíci
MidnightSt
MidnightSt

offtopic, but in my opinion: index, as the whole list - plural from that (many lists) is indexes. index, as a one number (id) - plural (many numbers where each serves as an id) indices.

Před 4 měsíci
Umm Probably No one
Umm Probably No one

But google doesn't use the binary search ,does it ?

Před 4 měsíci
Umm Probably No one
Umm Probably No one

Could you explain Page search next ?

Před 4 měsíci
Edmund of the Angles
Edmund of the Angles

When a corporate type like TS says someone was bad you know he's just covering himself

Před 4 měsíci
Tony32
Tony32

Dewey would have become president today 🤣

Před 4 měsíci
Mihoshika Furude
Mihoshika Furude

.. What kind of idiot would go into a book store, and ask by color?

Před 5 měsíci
Peter Tuijtjens
Peter Tuijtjens

The most amazing thing about binary search: If searching through x items takes (a maximum of) n comparisons, when you double the amount of items only takes n+1 comparisons. So with a 100.000 it's 16 times, 200.000 takes 17 tries.

Před 5 měsíci
John Heilman
John Heilman

There are many more strategies than just linear/binary to search a list. Easy Example: Probabilistic based upon guessing the distribution of the remaining items to be searched and where you should guess to maximize the speed at which you narrow the search space.

Před 5 měsíci
fish say helo
fish say helo

Please tom, 60 fps. My poor eyes

Před 5 měsíci
grendelkeep
grendelkeep

I still remember the time when the transition happened from Yahoo or Altavista (or metacrawler or however that was called), yielding results in 2-3 seconds, to that new thing, Google, without anything on the landing page except that search bar - and giving the results in *fractions* of a second. And they were so much better, so much more accurate, they found so many more sites! It was mind-blowing.

Před 5 měsíci
Chris
Chris

For a minute I thought you were talking about John Dewey and I was so confused lmfao

Před 5 měsíci

Další

Are There Problems That Computers Can't Solve?

07:58

Prečo manžel KRÁĽOVNEJ nebol KRÁĽ?

7:28

Prečo manžel KRÁĽOVNEJ nebol KRÁĽ?

Dejepis Inak

zhlédnutí 214K

Doraž na náplavku | POKÁČOVA RYCHLOVKA

1:38

Doraž na náplavku | POKÁČOVA RYCHLOVKA

Pokáčovo Kanál

zhlédnutí 228K

Why TRUE + TRUE = 2: Data Types

08:08

Why TRUE + TRUE = 2: Data Types

Tom Scott

zhlédnutí 702K

FizzBuzz: One Simple Interview Question

07:18

There is No Algorithm for Truth - with Tom Scott

59:34

There is No Algorithm for Truth - with Tom Scott

The Royal Institution

zhlédnutí 1,7M

The Worst Typo I Ever Made

11:25

The Worst Typo I Ever Made

Tom Scott

zhlédnutí 3,2M

Why Computers Can't Count Sometimes

08:44

Why Computers Can't Count Sometimes

Tom Scott

zhlédnutí 2,6M

Prečo manžel KRÁĽOVNEJ nebol KRÁĽ?

7:28

Prečo manžel KRÁĽOVNEJ nebol KRÁĽ?

Dejepis Inak

zhlédnutí 214K

Doraž na náplavku | POKÁČOVA RYCHLOVKA

1:38

Doraž na náplavku | POKÁČOVA RYCHLOVKA

Pokáčovo Kanál

zhlédnutí 228K

IMT Smile, Ben Cristovao - MIESTO

3:58

IMT Smile, Ben Cristovao - MIESTO

IMTSmileVEVO

zhlédnutí 477K

Koukr - Moonlight (OFFICIAL VIDEO)

4:19

Koukr - Moonlight (OFFICIAL VIDEO)

Blakkwood Records

zhlédnutí 44K

65 MILLION DOLLARS GENERATED

0:40

65 MILLION DOLLARS GENERATED

Jake Paul

zhlédnutí 2,7M