What's the fastest way to alphabetize your bookshelf? - Chand John

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2016
  • View full lesson: ed.ted.com/lessons/what-s-the-...
    You work at the college library. You’re in the middle of a quiet afternoon when suddenly, a shipment of 1,280 books arrives. The books are in a straight line, but they're all out of order, and the automatic sorting system is broken. How can you sort the books quickly? Chand John shows how, shedding light on how algorithms help librarians and search engines speedily sort information.
    Lesson by Chand John, animation by Anton Trofimov.

ความคิดเห็น • 3.8K

  • @happyconstructor
    @happyconstructor 4 ปีที่แล้ว +8661

    I love how the sign they chose for the broken *sorting system* is “Out of order”

    • @simplebutpowerful
      @simplebutpowerful 4 ปีที่แล้ว +222

      this comment made me happy to stumble upon

    • @matthewzhou7484
      @matthewzhou7484 4 ปีที่แล้ว +52

      that's hilariousss

    • @samueltong8061
      @samueltong8061 4 ปีที่แล้ว +21

      I don't get it

    • @kirtithapa7831
      @kirtithapa7831 4 ปีที่แล้ว +16

      Puncity

    • @happyconstructor
      @happyconstructor 4 ปีที่แล้ว +62

      L Jackson order. Sorting. Ordering things by letter. No order = no sorting. and out of order = broken machine which in this case is used for sorting

  • @buttered_numbat
    @buttered_numbat 4 ปีที่แล้ว +4003

    All the computer science kids - "I've trained my whole life for this"

    • @shambosaha9727
      @shambosaha9727 4 ปีที่แล้ว +99

      Years of academy training used

    • @Sluppie
      @Sluppie 4 ปีที่แล้ว +38

      Basically yeah. Being able to sort stuff in a hurry is a rarely used skill but still nice to have.

    • @jiyavarma4847
      @jiyavarma4847 4 ปีที่แล้ว +4

      insertion type beat

    • @invisibleimpostor299
      @invisibleimpostor299 4 ปีที่แล้ว +4

      I was gonna comment this!

    • @huton5429
      @huton5429 4 ปีที่แล้ว +2

      Shell sort all the way

  • @ludominguez4176
    @ludominguez4176 3 ปีที่แล้ว +951

    Pretend like you weren't there when the books arrived and act surprised.

    • @starsandstuff2100
      @starsandstuff2100 3 ปีที่แล้ว +116

      Yup. That's the way to go. Then when the students arrive tell them that the books havent come yet and when they point at the books just act surprised and ask them if they'd be so kind and help sort all the books :)

    • @moonlightdreamsxx2903
      @moonlightdreamsxx2903 3 ปีที่แล้ว +43

      @@starsandstuff2100 this is what we call genius

    • @jacobkreifels7690
      @jacobkreifels7690 ปีที่แล้ว +3

      and get fired

    • @hexyellow9873
      @hexyellow9873 ปีที่แล้ว +8

      It's called "Surprise Sort", also sometimes called "Fired Sort"

  • @RosenthalBros
    @RosenthalBros 4 ปีที่แล้ว +4334

    Bogo Sort: Throw all of the books everywhere several times until it is sorted.

    • @dikinebaks
      @dikinebaks 4 ปีที่แล้ว +299

      Best time O(1)

    • @andrewcheng1948
      @andrewcheng1948 4 ปีที่แล้ว +222

      Worst time oo(infinity)

    • @cwmd7651
      @cwmd7651 4 ปีที่แล้ว +48

      anywhere from several to infinite

    • @PVDH_magic
      @PVDH_magic 4 ปีที่แล้ว +47

      So that would be a 1/1280! shot to get right. From that we can estimate how many times we would need to randomize on average, and see what's the quickest way to check whether or not that they are in the correct order.
      To check if they are in order: Start at the first two books, and compare them, if they are in order move over to book 2 and 3, and so forth. If any two books are not in order, stop checking and randomize again.
      This may take a while; let's get started!

    • @trickytreyperfected1482
      @trickytreyperfected1482 4 ปีที่แล้ว +22

      @Unauthorized It should take way longer than that. 172 years if you're lucky

  • @lskyes
    @lskyes 7 ปีที่แล้ว +2321

    Or you can take your time cause you know no one will have their shit together for the first day of school

    • @thomasr.jackson2940
      @thomasr.jackson2940 7 ปีที่แล้ว +109

      Larissa Skyes and besides, your a student in a work study slot and get paid by the hour anyway.

    • @davidb5205
      @davidb5205 7 ปีที่แล้ว +10

      +Thomas R. Jackson LOL Accurate.

    • @TheCatHerder
      @TheCatHerder 7 ปีที่แล้ว +86

      The person who comes to the library on the first morning of class is also the person who's likely to freak out if they can't find a book though.

    • @fejfo6559
      @fejfo6559 7 ปีที่แล้ว +39

      Put your shit together Summer! (I hope someone gets it)

    • @anuvemula
      @anuvemula 7 ปีที่แล้ว +24

      how to troll
      read more

  • @ayeshan7499
    @ayeshan7499 5 ปีที่แล้ว +5702

    How to make it faster:
    *ask people to help*

    • @Firestar-rm8df
      @Firestar-rm8df 5 ปีที่แล้ว +254

      multithreaded quicksort. Nice.

    • @jasondeng7677
      @jasondeng7677 5 ปีที่แล้ว +30

      what if u have to friends

    • @damenhannah1
      @damenhannah1 5 ปีที่แล้ว +8

      That's just asking for indeterminacy.

    • @jasondeng7677
      @jasondeng7677 5 ปีที่แล้ว +3

      @Question Guy
      What if the people who work there reject

    • @CalculatedRiskAK
      @CalculatedRiskAK 5 ปีที่แล้ว +25

      Have one person help, and you suddenly have dual pivot quick sort.

  • @harrylamont6007
    @harrylamont6007 4 ปีที่แล้ว +2864

    “the books have been dropped off in one long straight line”
    idk about you but that seems like a pretty inconvenient way to drop off books

    • @Etherion195
      @Etherion195 4 ปีที่แล้ว +115

      especially, when the line is 1280 books long, which each book roughly 3-4cm thick (on average, i just looked at my bookshelf). It would make a line of 38-51m, IF the books are stacked tightly. If you take all the running into account, it will take far longer to sort. Plus, you'd probably need an ambulance after that:D

    • @erek
      @erek 3 ปีที่แล้ว +10

      You missed the whole point. It's not about how books are arranged, it's about finding a fastest way to sort the books.
      Stacking books in a straight line is for simplicity's sake.

    • @qaxser2900
      @qaxser2900 3 ปีที่แล้ว +62

      @@erek r/wooosh

    • @harrylamont6007
      @harrylamont6007 3 ปีที่แล้ว +6

      Mr. Communist r/ihavereddit

    • @harrylamont6007
      @harrylamont6007 3 ปีที่แล้ว +8

      @King [Retracted] to be fair i was actually 14 when i posted the original comment, lol

  • @gdlucky5238
    @gdlucky5238 4 ปีที่แล้ว +319

    I’ve watched countless “15 different sorting algorithms” videos before this, now I’m a pro

  • @blakejones3176
    @blakejones3176 4 ปีที่แล้ว +7625

    My instinct would be to find all the books beginning with 'a' and place them at the start of the line, then 'b', 'c' and so on.

    • @johnwilliams1621
      @johnwilliams1621 4 ปีที่แล้ว +1071

      This is essentially Radix sort.

    • @gbm7690
      @gbm7690 4 ปีที่แล้ว +875

      As a matter of fact, radix sort would be faster in many cases, including this one. After sorting the first letter, you can sort the second letter, by the third or maybe fourth letter, comparison sort would allow you to quickly sort the remaining subset of books.
      To increase the sorting time even further, you can lump common title names together like "the" and "one" and exclude them from the primary and secondary sorts to save a few iterations of checks.

    • @hamster548
      @hamster548 4 ปีที่แล้ว +24

      @@gbm7690 Same here

    • @reineh3477
      @reineh3477 4 ปีที่แล้ว +85

      I would do the same thing. It feels much easier

    • @bunysparks3494
      @bunysparks3494 4 ปีที่แล้ว +47

      @@johnwilliams1621 Mm, I thought it was called selection sort

  • @kantoros
    @kantoros 7 ปีที่แล้ว +4438

    OR you could repair the sorting machine.

    • @tabnk2
      @tabnk2 5 ปีที่แล้ว +81

      But that could take more than a week

    • @HarambaeXelonmuskfans
      @HarambaeXelonmuskfans 5 ปีที่แล้ว +115

      hey its the owners job not yours

    • @gobblox38
      @gobblox38 5 ปีที่แล้ว +62

      Are you certified to repair the machine?

    • @riccardorosso2795
      @riccardorosso2795 5 ปีที่แล้ว +3

      LOL

    • @XKT035
      @XKT035 5 ปีที่แล้ว +114

      the repair manual is in amongst the 1200 books

  • @morning5tarr
    @morning5tarr 4 ปีที่แล้ว +302

    I came here to learn how to move my books,
    Instead gained Computer science degree.

    • @christopherverdery1294
      @christopherverdery1294 4 ปีที่แล้ว +14

      Inaccurate. You don't get a CS degree unless you learn about sorting algorithms six times.

    • @not_herobrine3752
      @not_herobrine3752 3 ปีที่แล้ว +20

      @@christopherverdery1294 then watch this video ten times and become your local indian programming youtuber

    • @IamACrafter
      @IamACrafter 3 ปีที่แล้ว +3

      But I can assure you will master in sorting algorithm if u go watch the visualisation of sorting 30 times.

    • @NoelTheWanderer
      @NoelTheWanderer 2 ปีที่แล้ว +1

      Learn about the Dewey classification system and never get lost in a library again, this video gave me a headache since the alphabetically part is the last part in sorting books in a library

  • @Kapin05
    @Kapin05 3 ปีที่แล้ว +197

    "You work at the college library"
    No I don't
    _closes video_

  • @bookdream
    @bookdream 7 ปีที่แล้ว +3727

    I love when I already know information that's taught is these videos, it gives me such a great false sense of intelligence.

    • @davidbrick1260
      @davidbrick1260 7 ปีที่แล้ว +24

      Hobbes
      YAY! FEIGNED DISCOVERY!!

    • @bookdream
      @bookdream 7 ปีที่แล้ว +3

      TerrierZz SAME

    • @AB-bg7os
      @AB-bg7os 7 ปีที่แล้ว +3

      Hobbes ikr

    • @leohoang773
      @leohoang773 7 ปีที่แล้ว +9

      Isn't that just how advertise works?

    • @arshad887
      @arshad887 7 ปีที่แล้ว +12

      Literally me because of Java and Python

  • @rainbowsomeone
    @rainbowsomeone 6 ปีที่แล้ว +921

    I used this, but I realized too late that I alphabetized by title instead of author.

    • @gamingcookiereal
      @gamingcookiereal 5 ปีที่แล้ว +36

      isn't that how sorting books works though

    • @mabellew6445
      @mabellew6445 5 ปีที่แล้ว +49

      cammiecookies but i mean what if you have books that are in a series with different starting letter in the title, imagining looking for them after you’re done. i sort by author too

    • @Lord_zeel
      @Lord_zeel 4 ปีที่แล้ว +19

      @@mabellew6445 Sort by title of series. This results in all books in each series being next to each other (though, like with author, not necessarily in the correct internal order), but they will be easier to find assuming the searcher doesn't know the name of the author. For instance, if you are looking for (The) Lord of The Rings, but are not aware of Tolkien, you can still find it under 'L'.

    • @molly.dog8brooke792
      @molly.dog8brooke792 4 ปีที่แล้ว +11

      cammiecookies
      Haven’t you ever been to a library, or a bookstore? 😀

    • @metromaru
      @metromaru 4 ปีที่แล้ว +1

      cammiecookies Come to my school it might be confusing for you

  • @SacsachCCABP
    @SacsachCCABP 3 ปีที่แล้ว +139

    Me, an intellectual:
    Watch the colours

    • @shreeya6176
      @shreeya6176 3 ปีที่แล้ว +5

      that's so smart I would just procrastinate and not do it ..lol

  • @shubinternet
    @shubinternet 2 ปีที่แล้ว +95

    Having worked in a library, and having a BSCS degree where we carefully examined Knuth “Sorting and Searching”, I can assure you that none of these algorithms translate well for human beings.
    In the real world, we would most likely create small stacks of books, in groups that can be easily handled by a human - say, about 10 or so. Then sort each stack. Then merge the stacks, one by one.

    • @faihan988
      @faihan988 2 ปีที่แล้ว +64

      Which is also known as mergesort.

    • @shubinternet
      @shubinternet 2 ปีที่แล้ว +11

      @@faihan988 -- D'oh! I had never made that connection before. Sigh.....

    • @sajeucettefoistunevaspasme
      @sajeucettefoistunevaspasme 2 ปีที่แล้ว +5

      As I humaun being I promise that I am a humam being
      I would just add them and put them where I think is good
      and then look at it to correct my errors
      small problem computers can't just say "oh mate I feel like this 0 is not the biggest number since I saw a 329something so I'll start with mate"

    • @shubinternet
      @shubinternet 2 ปีที่แล้ว +6

      That said, having worked in a Library shelving books for almost five years during college, I would use the Library of Congress system. Of course, that means I'd have to look up the LC data based on the ISBN of every book or magazine I buy. But there are tools for that, and you can easily scan barcodes with your phone or a dedicated barcode reader.

    • @aguyontheinternet8436
      @aguyontheinternet8436 ปีที่แล้ว +1

      @@faihan988 there are probably over 50 different sorting algorithms, each with tons of different subsets. If someone managed to efficiently sort something in a way that meets none of those definitions, the number of sorting algorithms will simply go up by 1

  • @akinmytua4680
    @akinmytua4680 7 ปีที่แล้ว +1609

    as someone who worked in libraries, you find yourself doing #3 almost automatically. (if there are less than 10 books, you use #2) Just wanted to express what a good example this is.

  • @blueberry1c2
    @blueberry1c2 6 ปีที่แล้ว +1905

    What about *b o g o s o r t*

    • @invenblocker
      @invenblocker 5 ปีที่แล้ว +361

      "It's all sorted!"
      *looks at date*
      "And right on time too."
      *looks at year*
      "Ah crud."

    • @ian2668
      @ian2668 5 ปีที่แล้ว +51

      NO!! ANYTHING BUT BOGO SORT! PLEASE NO!

    • @underscoredfrisk
      @underscoredfrisk 5 ปีที่แล้ว +78

      Gimmie 4734231678547 years. I will sort the first 2 books

    • @rosearachnid879
      @rosearachnid879 5 ปีที่แล้ว +33

      My friend tried, he died before he could sort the first book.

    • @Roman_Noodles
      @Roman_Noodles 5 ปีที่แล้ว +108

      Bogosort, assuming one second per comparison, would take an average of 3.05 x 10^3415 years, aka 30,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 years
      Now that's efficiency

  • @clarkevander
    @clarkevander 3 ปีที่แล้ว +78

    TH-cam: wanna know the fastest way to alphabetize books?
    Me: well, it's 3am and has been years since I last held a paper book but OK

    • @mariaelenalopez7055
      @mariaelenalopez7055 3 ปีที่แล้ว +1

      Lol.

    • @sethb3090
      @sethb3090 ปีที่แล้ว

      The worst part is that the video is wrong. This isn't even the fastest way for a computer to alphabetize books, let alone a human.

  • @captainminnow
    @captainminnow 2 ปีที่แล้ว +189

    I thought this was actually about bookshelves, and was baffled why there weren’t 26 piles of books. I’m pretty sure I could sort 1200 books into 26 piles in 90 minutes or less, and then alphabetize each pile in another 90

    • @FrenkTheJoy
      @FrenkTheJoy 2 ปีที่แล้ว +11

      I don't know, man, I have about 23 alphabetical piles of books (well actually 30, there's multiple piles for some letters), around 400 books, and it took several hours. 1280 books is a lot.

    • @soondartube
      @soondartube 2 ปีที่แล้ว +2

      Exactly, that was how I sorted invoices 20 years ago as an intern

    • @BassRemedy
      @BassRemedy 2 ปีที่แล้ว

      thats impressive!

    • @andrewmat
      @andrewmat ปีที่แล้ว +2

      I think this is called Radix Sort

    • @sethb3090
      @sethb3090 ปีที่แล้ว +1

      That's a radix sort and it's actually really good for this kind of thing. I'd take it over quicksort for this job.

  • @bg6b7bft
    @bg6b7bft 7 ปีที่แล้ว +785

    Or you could label shelves with letters, and put books on those shelves if they start with that letter.
    Then sort each shelf. This is called a bucket sort.

    • @brightwave28
      @brightwave28 7 ปีที่แล้ว +50

      bg6b7bft What you are talking about is called bucket sort not heap sort.

    • @bg6b7bft
      @bg6b7bft 7 ปีที่แล้ว +40

      Fixed, thanks.

    • @xystem4701
      @xystem4701 7 ปีที่แล้ว +47

      Yeah, then you'd get a more consistent version of the partitions, without having to note the separation between partitions and their groups. It's also better given the actual context of the situation.

    • @ProfessorSyndicateFranklai
      @ProfessorSyndicateFranklai 7 ปีที่แล้ว +27

      Isn't that kind of just a more organized way of doing QuickSort's Partitioning?

    • @bovo698
      @bovo698 7 ปีที่แล้ว +1

      bg6b7bft the problem is that you can sort just letters, not number or symbols

  • @Intrafacial86
    @Intrafacial86 5 ปีที่แล้ว +2708

    I actually tried gravity sort once.
    They stopped me before I could finish throwing them out the nearest window.

    • @kimmaquiling8593
      @kimmaquiling8593 5 ปีที่แล้ว +78

      Intrafacial86 you should try intern sort. Very easy.

    • @pancakes6587
      @pancakes6587 5 ปีที่แล้ว +15

      HA

    • @gizmogamingmore8881
      @gizmogamingmore8881 5 ปีที่แล้ว +62

      My personal favorite is fire sort, but if you wanna do the longer way do goodwill sort.

    • @turtleyoutuber3837
      @turtleyoutuber3837 4 ปีที่แล้ว +18

      I like not my problem sort
      Or
      Random order sort

    • @PrunselClone
      @PrunselClone 4 ปีที่แล้ว +5

      lmbo

  • @nadiabouk8712
    @nadiabouk8712 4 ปีที่แล้ว +103

    Of course, it is probably a lot easier to sort the books when they are all organized by color

  • @thefloppykangaroo1984
    @thefloppykangaroo1984 4 ปีที่แล้ว +363

    Oh yeah, I hate it when a shipment of 1200 books gets delivered at my house

    • @JosephSeabourne
      @JosephSeabourne 3 ปีที่แล้ว +19

      Uh ikr so annoying

    • @anshisalad
      @anshisalad 2 ปีที่แล้ว +5

      the only good thing is that you get a lifetime supply of books, but that will need lotsa sorting

    • @kamion53
      @kamion53 2 ปีที่แล้ว +1

      I hate it even more when they dump it at the neighbours in the appartment because they came at a time I wasn't home
      and jugding from the way a certain on-line shop has the tendency to pack items in boxes that are 5 times the item, such a delivery would probably block the whole street.

    • @BassRemedy
      @BassRemedy 2 ปีที่แล้ว +1

      ughhh its just the worst 🙄

  • @canaldeyt494
    @canaldeyt494 7 ปีที่แล้ว +230

    That awkward moment when you don't have books, but its still useful for your videogames.

    • @vulpes133
      @vulpes133 7 ปีที่แล้ว +7

      Elder Scrolls? I'm guessing Elder Scrolls. I know I try to collect at least one of each book, even if I'll only read a few of them.

    • @oldcowbb
      @oldcowbb 7 ปีที่แล้ว +3

      i sold all my books to wiinterhold library

    • @TheRealPentigan
      @TheRealPentigan 7 ปีที่แล้ว

      Usually whatever house mod I'm using that autosorts my crafting materials usually also autosorts books but also doesn't the inventory window automatically sort everything by alphabetical order unless you're using a different order in SkyUI?

    • @rakuengrowlithe4654
      @rakuengrowlithe4654 7 ปีที่แล้ว

      43 hours on current Special Edition playthrough and I've never gone to Winterhold. Don't think I had any reason to avoid it but then I was so far in, it felt silly to visit for the first time.

    • @HyLion
      @HyLion 6 ปีที่แล้ว +1

      I'm gonna organize all my switch games! First goes Mario Odyssey.... then in goes Zelda Breath of the Wild... DONE!
      (I'm not joking, these are the only switch games I own xD)

  • @Kazyu
    @Kazyu 7 ปีที่แล้ว +1237

    Easiest way possible.
    1.) Don't touch the books
    2.) When students find there book, they check it out.
    3.) Have them put it in its correct spot.
    4.) Take the day off

    • @cloudcirrus5515
      @cloudcirrus5515 6 ปีที่แล้ว +99

      Corpsgrinder360 you're hired

    • @minecraftminertime
      @minecraftminertime 5 ปีที่แล้ว +19

      their*

    • @steeledminer616
      @steeledminer616 5 ปีที่แล้ว +17

      Waitwaitwait...
      So you're saying the current method DOESN'T have to be changed?

    • @shannonalex9169
      @shannonalex9169 5 ปีที่แล้ว +8

      So I'm not allowed to breathe?

    • @amywang3890
      @amywang3890 5 ปีที่แล้ว +2

      ugh

  • @mihiguy
    @mihiguy 4 ปีที่แล้ว +79

    In practice I'd use Radix Sort (as others already suggested) instead of Quick Sort, and the reason is that comparing authors is not constant time for my brain (it takes much longer to compare Bradbury to Bradley than Asimov to Verne). For radix sort you only compare one letter (where the letters before are the same) so it should be a lot quicker.

    • @sethb3090
      @sethb3090 ปีที่แล้ว +17

      Yeah, I got to the end of the video and went "well, another video that thinks quicksort is the best for any arbitrary problem..."

    • @flatfingertuning727
      @flatfingertuning727 ปีที่แล้ว +1

      Quicksort could benefit greatly from a comparison method that could be told "until further notice, all items being compared will be between ___ and___", determine how much of the key matched, and then only look at the later parts of the key while processing items within a partition.

  • @archonofcommorragh1221
    @archonofcommorragh1221 4 ปีที่แล้ว +37

    Well, I separate my books into languages and sizes. Greek, my native language, gets a portion of my library and English gets the other. From that, I go on comparing sizes, from biggest to smallest. The only exception I make is in a book series where I put them in series order no matter the size. Though that is usually not a problem, because series almost always are the same size.

  • @CementCakeisboss101
    @CementCakeisboss101 7 ปีที่แล้ว +259

    This would take be longer because I would be reciting the ABC's in my head trying to remember what comes before/after a letter

    • @SuspirosdaBea
      @SuspirosdaBea 5 ปีที่แล้ว

      aahah same

    • @Quirktart
      @Quirktart 5 ปีที่แล้ว

      That's why I would do the bubble emthod but reverse

    • @erhixon773
      @erhixon773 5 ปีที่แล้ว +1

      People who know which number corresponds to which letter in the alphabet are scary.
      Or in this case, people who knows which comes after a specific letter in the alphabet without reciting it is scary.

    • @SilverishKitten
      @SilverishKitten 5 ปีที่แล้ว

      @Erhixon7
      It's probably easy enough to learn to memorize... But except for librarians, it just seems pointless to do.

    • @ashthepokemonmaster2375
      @ashthepokemonmaster2375 5 ปีที่แล้ว

      *me

  • @TrapMusicNow
    @TrapMusicNow 7 ปีที่แล้ว +1435

    Get some college kids to do it for you. Call them interns. This will take about 1 second. Go have a smoke now.

    • @Christine.3671
      @Christine.3671 7 ปีที่แล้ว +1

      Trap Music NOW.
      Is your channel good?

    • @Christine.3671
      @Christine.3671 7 ปีที่แล้ว +2

      Trap Music NOW. Oh and good method XD

    • @MasterWoof371
      @MasterWoof371 7 ปีที่แล้ว +9

      Trap Music NOW. Why collage?? Why not University students?!? Weird Americans.

    • @danem2215
      @danem2215 6 ปีที่แล้ว +17

      Alex Barker "Collage?" Weird foreigners.

    • @MasterWoof371
      @MasterWoof371 6 ปีที่แล้ว +1

      Dane Maricic I don't get what you mean

  • @SoCal_Jeff
    @SoCal_Jeff 3 ปีที่แล้ว +6

    Okay, my on-campus JOB in college - LITERALLY - was sorting and reshelving books and scientific journals. We had five floors, and all was based on the Dewey Decimal System. We had a "rough sort" area and a "fine sort" area, about 15 shelves for each area. After some experience, it took me about an hour to sort through a whole mess of books and load up about 10 book carts. Reshelving individual books took a bit longer, but we all got really good at it. Not to mention the leg muscles I built up squatting down with armloads of books. For some reason, those all-important scientific journals always seemed to be housed on the bottom shelves!

  • @VectorJW9260
    @VectorJW9260 3 ปีที่แล้ว +15

    How I'd describe Radix Sort:
    Go through the books, and put them in different boxes depending on their starting letter. This requires 1,280 movements. Then, go through each box and put the books in that box into different boxes based on their second letter. This also requires 1,280 movements. In the average scenario, you now have 1-2 books per box, and 576 boxes. You can now just put books on the shelf, and swap those that are in the wrong order. This is likely 2,560 more movements. If it takes 1 second to do a movement like before, then this takes around an hour.

    • @st_s3lios860
      @st_s3lios860 ปีที่แล้ว

      But you need a lot of boxes

    • @captainmayo0505
      @captainmayo0505 ปีที่แล้ว

      @@st_s3lios860 you can just pile them up......no need for boxes.....

    • @11cookeaw14
      @11cookeaw14 11 หลายเดือนก่อน

      @@st_s3lios860 Not If you apply Stage 2 to one letter at a time. (e.g. Do all the A's, then all the B's...

  • @parisnic8775
    @parisnic8775 7 ปีที่แล้ว +1890

    Or in your guys case, organize them by color.

    • @juhotuho10
      @juhotuho10 7 ปีที่แล้ว +55

      the color is there just to help you see and imagine how the books move and how they should be

    • @fargotua13
      @fargotua13 7 ปีที่แล้ว +16

      color is just a symbol of a letter
      that way is more eazy to the eye.

    • @-.._.-_...-_.._-..__..._.-.-.-
      @-.._.-_...-_.._-..__..._.-.-.- 7 ปีที่แล้ว +103

      Computers aren't very good at sensing humor.

    • @parisnic8775
      @parisnic8775 7 ปีที่แล้ว +28

      I was just joking lol

    • @fargotua13
      @fargotua13 7 ปีที่แล้ว +1

      Paris0825 same
      ;-p
      def

  • @LARAUJO_0
    @LARAUJO_0 7 ปีที่แล้ว +362

    what kind of library sorts non-fiction books into alphabetical order

    • @Dougiewoof
      @Dougiewoof 5 ปีที่แล้ว +18

      This one

    • @Veronicz
      @Veronicz 5 ปีที่แล้ว +6

      Did they say it was non-fiction?

    • @archdukefranzferdinand567
      @archdukefranzferdinand567 5 ปีที่แล้ว +10

      @@Veronicz most college books are non fiction

    • @Goobyster
      @Goobyster 5 ปีที่แล้ว

      Its pretende time laraujo

    • @blanktheyeet6131
      @blanktheyeet6131 4 ปีที่แล้ว

      uh, okay you're right lol

  • @NieMonD
    @NieMonD 4 ปีที่แล้ว +579

    I feel like this is being over-complicated. Just sort all of them into piles of the same letter and stack them

    • @erikbrendel3217
      @erikbrendel3217 4 ปีที่แล้ว +138

      That is called bucket-sort, and would only do the job if these books really just had one letter. But a book is not just called "A", but has a longer title. You would still need to sort all the books inside your "A"-pile. You would have some multi-step sorting similar to QuickSort -> RadixSort

    • @syra1541
      @syra1541 4 ปีที่แล้ว +2

      Right

    • @DocFunkenstein
      @DocFunkenstein 4 ปีที่แล้ว +46

      @@erikbrendel3217 Yep, and since the scenario is about physical books in the real world, being sorted by human beings, it would be the fastest method BY FAR. Every one of these sorting methods is ridiculously over-complicated and not at all feasible for humans, who'd have to be shoving entirely silly amounts of weight with all the shifting of books and whatnot.
      And, additionally, this scenario COMPLETELY negated the secondary sorting of books. None of those methods included the full titles in their calculations, so trying to add that on to prove how smart you think you are is just embarrassing for you.

    • @cityuser
      @cityuser 4 ปีที่แล้ว +35

      @@DocFunkenstein ...no. All these methods include sorting the whole surname, since "aa" would come before "ab". Takes no extra time and works the same way. They just showed them as letters for simplicity.

    • @DocFunkenstein
      @DocFunkenstein 4 ปีที่แล้ว +4

      @@cityuser Wrong. Not a single example showed multiple cases of the same letter being repositioned within their subcategory, and most of the methods would require that.

  • @Diplomatecogirl
    @Diplomatecogirl 4 ปีที่แล้ว +28

    By experience, just do pile of "a" "b" "c".... then class them in alphbetical order inside each pile usually by quick sort then put them all on the shelves. but you do you ;)

    • @kabochaVA
      @kabochaVA 4 ปีที่แล้ว +5

      That first step is called "pigeonhole sort".
      It's very effective when it can be employed, and I was expecting to see it mentioned in the video.
      It mean, even by just looking at the wikipedia page for "sorting algorithm" you can find the pigeonhole under "Non-comparison sorts", a section they seem to have completely ignored when putting this video together.
      But yeah, that's TED... (whose slogan should be "ideas grossly overlooked and over-simplified")

    • @marcusscience23
      @marcusscience23 ปีที่แล้ว

      Instead of quick sorting each pile, arrange them by second letter and repeat with third letter and so on. This is Radix Sort.

  • @altiverse198
    @altiverse198 6 ปีที่แล้ว +211

    Any programmer here should be like "Oh.. so that's how they teach librarians time complexity..."

    • @Sluppie
      @Sluppie 4 ปีที่แล้ว +7

      I pretty much thought it was going to be a metaphor for sorting algorithms, and when I saw her do bubble sort my suspicions were confirmed.

  • @RinoaL
    @RinoaL 7 ปีที่แล้ว +1504

    not the dewey decimal system? either way i'd go through the pile of books, tossing them into 27 piles depending on their first character, then organize the piles, thats whats always worked for me.

    • @rhapsoblu
      @rhapsoblu 7 ปีที่แล้ว +120

      Radix sort en.wikipedia.org/wiki/Radix_sort

    • @freshrockpapa-e7799
      @freshrockpapa-e7799 7 ปีที่แล้ว +29

      That only works for letters, you are missing the point of the video..

    • @rhapsoblu
      @rhapsoblu 7 ปีที่แล้ว +159

      Aren't the titles of the books made out of letters? You have to give me a little more to work with then just stating that I missed the point of the video.

    • @freshrockpapa-e7799
      @freshrockpapa-e7799 7 ปีที่แล้ว +12

      John Donahue There are other things to sort other than books.

    • @D4SSW4SSUP
      @D4SSW4SSUP 7 ปีที่แล้ว +44

      Eric Pive, what are you even talking about you convoluted turd? You're the one missing the point of this comment.

  • @TheNutCollector
    @TheNutCollector ปีที่แล้ว

    Thank you for this explanation. I went to 4 different videos trying to get a quick overview of what quicksort is and why it would be used and they all started by explaining the nitty-gritty details without explaining what it is used for.

  • @kaff_1o169
    @kaff_1o169 3 ปีที่แล้ว

    As a volunteer/worker at an archive, jazz archive in Denmark. A place where there are 66.000 collection of jazz samples, cd's, vinyls, etc. I came across this video and learnt the quick sort method, it really helps the fast process on gathering samples together. And I got to mention that the archive only depends on volunteer worker, having no machine that could order the samples in chronological order or alphabetical order and besides the data base (PC), mostly everything is done by hand.
    It feels really great on doing such work, by sorting things together chronologically and alphabetical order. The work is long and sometimes devistating, but the result are very satisfying.
    Now, I have a dream education in working such places like an archive, libraries, old bookstore and such, cause everyday it feels like a long puzzle and every each bit and pieces has a story they have to tell.
    The great thing I'm looking forward to, is to learn new ways on sorting things out.
    "For those who played WoW back in 2004-2007."
    It really makes it feel like playing World of Warcraft (vanilla) where you had to grind the last part to the endgame, really adventurous!
    Thank you for sharing such knowlegde!
    Cheers!
    - Kaff.

  • @jadeshiota784
    @jadeshiota784 7 ปีที่แล้ว +336

    It's also pretty easy when the books are a fucking spectrum of colors....

    • @oldcowbb
      @oldcowbb 7 ปีที่แล้ว +12

      you ever try the colorblind sorting test? it's horrible

    • @jadeshiota784
      @jadeshiota784 7 ปีที่แล้ว +3

      Nope not once,

    • @fburton8
      @fburton8 7 ปีที่แล้ว +15

      It depends how good your colour vision is, I suppose.

    • @ratmcgee8464
      @ratmcgee8464 7 ปีที่แล้ว +1

      oldcowbb I got a zero on it, a perfect score
      All I have to say is Day-um

    • @papasfritas4480
      @papasfritas4480 6 ปีที่แล้ว +1

      Its worse than the hemospectrum, for sure.

  • @ShankarSivarajan
    @ShankarSivarajan 7 ปีที่แล้ว +245

    I think my college library uses bogosort...
    (To be fair, students probably keep randomizing the shelves.)

  • @michelemassa3029
    @michelemassa3029 ปีที่แล้ว

    Very cool way to introduce these CS concepts, a cool thing is that many of the existing sorting algorithms can be heavily optimized given we know the range that the elements belong to (a to z) meaning that for example, for quicksort we can always pick the exact element that will partition our lists the best way, yielding a best case running time (assuming we can get to these elements relatively quickly rather than having to look through the entire list of books for them)

  • @TheChickenFairy.
    @TheChickenFairy. 3 ปีที่แล้ว +2

    where was this video when I needed it for cs classes

  • @icgantshat
    @icgantshat 7 ปีที่แล้ว +231

    The irony is that if you give this task to a human, they'll figure out a pretty fast way, without any of this knowledge.

    • @razorIaIa
      @razorIaIa 7 ปีที่แล้ว +31

      all algorithms comes from humans. its no surprise you are already using 1.

    • @Lisferator
      @Lisferator 7 ปีที่แล้ว +4

      this is because we can identify the letters, if instead letters were variables, we would need a formula

    • @top1percent424
      @top1percent424 7 ปีที่แล้ว

      icgantshat Well, only humans before us figured out stuffs that we read, learn and watch today everywhere.

    • @huntsvilleadventurer
      @huntsvilleadventurer 7 ปีที่แล้ว +5

      This is because the human brain is exponentially better at solving problems than computers for now. A.I. at its best can find information and spout it out, but learning how to sort on its own? I don't think a computer has ever "learned" how to sort. It is always "told" how to sort.

    • @hanniffydinn6019
      @hanniffydinn6019 7 ปีที่แล้ว +4

      icgantshat yes this is computer algorithms for dumb computers, not really how humans sort books that can recognise actual letters. You know A is the start and z is the end and can see that instantly in a large pile of books.

  • @christinawisdom1128
    @christinawisdom1128 6 ปีที่แล้ว +451

    this helped me sort my yugioh cards

    • @lvjycd
      @lvjycd 5 ปีที่แล้ว +6

      Bee Keeper this kills me 🤣🤣

    • @TarigonTetradactyl
      @TarigonTetradactyl 5 ปีที่แล้ว +16

      if i had a penny for every time i wasn't cool i'd have *no pennies*

    • @michka841
      @michka841 4 ปีที่แล้ว +1

      THEORICAL INFORMATICS PHD

  • @kyledecena4959
    @kyledecena4959 2 ปีที่แล้ว

    It is in our programming class, thank you for making it easier to understand.

  • @noticias6111
    @noticias6111 4 ปีที่แล้ว

    Speaking as someone who works shelving at a library the 'quick sort' method brought up from 2:42+ onward closely resembles what I do in practise with most non-serial based fiction DVD's (movies instead of say seasons of a TV show or documentaries) since I'm not following the 'Dewey decimal system' or (in say a post-secondary setting) the 'library of congress' system. I appreciate knowing how there is a bona fide significance of sort to (2: insertion sort) and (1: bubble sort).

  • @andyshinnerl9151
    @andyshinnerl9151 7 ปีที่แล้ว +129

    Just look at the color of the book. It makes it waaaaay easier.

    • @whatif3271
      @whatif3271 7 ปีที่แล้ว

      Andy Shinnerl XD

    • @asmahappy6373
      @asmahappy6373 6 ปีที่แล้ว +1

      That only works for her.

    • @marvinkitfox3386
      @marvinkitfox3386 5 ปีที่แล้ว +3

      Why?
      Can you *really* easier see 26 shades of color in the correct sequence, rather than just sorting by alphabet?
      I find it much easier to know that Q is before R and after P, than to know that Lavender is to the right of Mauve but left of Taupe.

  • @dakota5671
    @dakota5671 7 ปีที่แล้ว +542

    I take the books that start with A and put them in a pile, and so on and so forth. Then, I go through the A books and sort them by AB, AC, AD, AE; until all books are sorted.

    • @TheMacpardo
      @TheMacpardo 7 ปีที่แล้ว +107

      well that would be Radix Sort :) depending on the length of the book names and the number of books, it might or not be better than Quicksort.
      Edit: Actually, comparing two books by alphabetical order takes so long that your method is always better in that case.

    • @aresistar8285
      @aresistar8285 7 ปีที่แล้ว +10

      I havn't watched the vid, tho, I'm guessing they are using QuickSort or MergeSort which is both have a complexity of n log(n). Doesn't Radix Sort have complexity of n*k?

    • @TheMacpardo
      @TheMacpardo 7 ปีที่แล้ว

      Ares iSTAR they use quick sort. And yes, radix sort is O(n*k)

    • @penisdestroyer619
      @penisdestroyer619 7 ปีที่แล้ว +12

      dude or u could just ask from help from the rest of the staff and that makes it a whole lot easier

    • @johannahesse8327
      @johannahesse8327 6 ปีที่แล้ว

      TheMacpardo same

  • @daltoncarverxc
    @daltoncarverxc 10 หลายเดือนก่อน +1

    Rough/relative alphabetization first, then specific alphabetization. Put books in piles such as A-D, E-H, etc, then organize those sections.

  • @scout6436
    @scout6436 3 ปีที่แล้ว

    this was so calming to watch

  • @markkeith9055
    @markkeith9055 7 ปีที่แล้ว +95

    Knowing the alphabet helps tremendously. Thanks Alphabits.

    • @alexandre3989
      @alexandre3989 7 ปีที่แล้ว

      Exactly. If you're doing a quick sort, don't pick a book starting with an a or z because those won't make very good partitions.

    • @omairbhore
      @omairbhore 7 ปีที่แล้ว

      Alexandre Pinho my man knows. Gotta have a good pivot or else q-sort is useless

    • @GuilhermeCarvalhoComposer
      @GuilhermeCarvalhoComposer 7 ปีที่แล้ว

      Thanks, alphabet. Thalphabet.

    • @markkeith9055
      @markkeith9055 7 ปีที่แล้ว +3

      Alpha bits is a cereal from Post. In case you missed that.

    • @GuilhermeCarvalhoComposer
      @GuilhermeCarvalhoComposer 7 ปีที่แล้ว

      I did suppose "Alphabits" was not a typo at all, but I wasn't aware of the cereal.
      Still wanted to make the _Look Around You_ reference anyway. :)

  • @muchachacristiana
    @muchachacristiana 7 ปีที่แล้ว +28

    As someone who has quite a bit of experience working at the college library, here are my thoughts: I tend do something LIKE the insertion sort. But it isn't a pure insertion sort because I compare the book I'm working on to the books in the general area of where I remember it should go (someone previously mentioned this is an informed insertion sort). While the quick sort seems great in theory, the reality is that manipulating such a large amount of books is an important factor to consider (as in the example given). There are physical limitations. This would work best on one shelf, or on one book cart, but with that you're already working with such a small number of books that it probably doesn't REALLY matter. Also, most libraries already have a pre-sorted collection in which the new items are integrated into... which is a pretty significant factor to consider in terms of real world application of this system of sorting. Again, the theory is fun and I appreciate the thought put into it and the thoughts it's provoked (reading all the comments was entertaining), but real world application is a different story.

  • @divxxx
    @divxxx ปีที่แล้ว +1

    I'm happy to say this is usually sort of what I do when I sort my collections.

  • @yt-sh
    @yt-sh 2 ปีที่แล้ว

    by far the best algorithm video I came across!

  • @jiaming5269
    @jiaming5269 7 ปีที่แล้ว +34

    Nice intro to sorting algorithms!!

  • @rebeccar8359
    @rebeccar8359 7 ปีที่แล้ว +32

    I work at a library, so if we ever have to sort this many books, I'll share this strategy with my coworkers!

    • @rlamacraft
      @rlamacraft 7 ปีที่แล้ว +18

      You'd be better of doing a Bucket Sort; i.e. a pile for each letter, then recursively repeat on the second letter of each pile, then third, etc. - you'll just need quite a bit of space

    • @PeterNjeim
      @PeterNjeim 7 ปีที่แล้ว +2

      Yes, quicksort isn't that quick in my opinion.

    • @justinward3679
      @justinward3679 7 ปีที่แล้ว

      Rebecca Potato I don't have enough memory for quicksort.

    • @rebeccar8359
      @rebeccar8359 7 ปีที่แล้ว

      Yeah, generally, my coworkers and I divide up our books into their Dewey decimal categories by hundreds, and then fiction by letter, in piles. It gets a little tricky when you get to the kids' books and their many strange categories, but at least it narrows down the areas in which they need to go. XD

    • @singleT314
      @singleT314 7 ปีที่แล้ว

      this was wrong. Quick sort is not even the fastest comparative sorting algorithm. Since books have a natural order you can use a non comparative sort. Yes your method of dividing into dewey decimal by hundreds is better than the quicksort they listed. Quicksort is generally fast but only for comparative elements.

  • @katrinabryce
    @katrinabryce 4 ปีที่แล้ว +1

    With an insertion sort, you can do the comparisons much quicker than one per second. It would be about a second or two for each round of sorting. It is the actual physical moving of the book in and out the pile that takes time. Different for computers though.

  • @Awesomo4000
    @Awesomo4000 4 ปีที่แล้ว

    Other option. Write down all the names in a spreadsheet with their current position in the next column and sort by name.
    Now you have a lookup table for each of the books.
    This list can be used to sort the books really quickly. By going over the sorted list one item at a time, finding it's position in the first stack, and moving it to the end of the sorted stack. (The name of the book you're currently looking at can give directions to where you need to be looking for the next book)

  • @quint4785
    @quint4785 6 ปีที่แล้ว +14

    4:08 the prices have the gray dot effect

  • @danielderwertvolle6354
    @danielderwertvolle6354 5 ปีที่แล้ว +48

    time sort is great, too.
    it works like this:
    1. treat the book titles as base 26 numbers (or however many letters your alphabet might have) and convert them to your preferred number system
    2. acquire some alarm clocks and place one on each book.
    3. Now set each alarm to its corresponding book's number (from step 1) of seconds into the future.
    4. Now everytime an alarm goes off you just take that book and place it into your book shelf.
    It's that easy.

    • @squidwardfromua
      @squidwardfromua ปีที่แล้ว +5

      But you need thousand of alarms

    • @aguyontheinternet8436
      @aguyontheinternet8436 ปีที่แล้ว +9

      @@squidwardfromua semantics

    • @microwavecoffee
      @microwavecoffee ปีที่แล้ว +6

      It's a very cool thought, was wracking my brain for a bit.
      It's O(N^2) tho each alarm hides a linear time operation, where it checks if each moment of time is equal to the 'time' of the book.

    • @reidflemingworldstoughestm1394
      @reidflemingworldstoughestm1394 ปีที่แล้ว +1

      That's what I always do.

    • @danielderwertvolle6354
      @danielderwertvolle6354 ปีที่แล้ว +3

      @@microwavecoffee I think it's O(n*m) with m being the largest number or in this case the longest book title. But that's usually just worse than O(n²) plus the massive overhead of setting all those alarms.
      It's a similar trick to counting sort or radix sort in the sense that it's not comparison based and scales with the size instead of just the amount of your items.

  • @darbyl3872
    @darbyl3872 8 หลายเดือนก่อน +1

    Step 1. Bucket Sort, if possible (alphabetical or by genre / dewey decimal group).
    Step 2. Quick Sort each bucket / group / set of shelves, if practical (as books are put on shelves. Put 'N' or '0.5' divider in the middle, 'G' or '0.25' divider on the left, and 'S' or '0.75' divider on the right.)
    Step 3. Insertion Sort each section.
    Alternate Step 3. Selection Sort, if sorted items need to be complete, not missing any items, and ready for immediate use, which is rare.

    • @polymations
      @polymations 2 หลายเดือนก่อน +2

      You don't need step 3, as quick sort is recursive. First, you can either select a random pivot or the middle pivot, split the books into letters before it and ahead of it, then choose a random or the middle one for each of the sections. Do this until you reach a section with only one book. Put that section behind the last section. At the end, you should have the sorted books.

  • @leeolsson5271
    @leeolsson5271 4 ปีที่แล้ว

    I love listening to this sort of theories. It’s fascinating.

  • @disneyalien6930
    @disneyalien6930 7 ปีที่แล้ว +135

    USE THE VOLUNTEERS

  • @kadenlacey3205
    @kadenlacey3205 7 ปีที่แล้ว +261

    I always orginize my books by height. the tallest/biggest book comes first, and the shortest/smallest goes last. It makes it look nice and neat. If I have lots of books with the same height, (which i do) i organize them by series or color.

    • @toptenfamous
      @toptenfamous 7 ปีที่แล้ว +2

      me too

    • @negrolegendario
      @negrolegendario 7 ปีที่แล้ว +1

      OCD for the win!

    • @xyrissavage4983
      @xyrissavage4983 6 ปีที่แล้ว +4

      Kaden Lacey I usually organize my books by order in sieres and hight, if a book doesnt have a sieres or i dont have the other books, i just do it by hight.

    • @user-sx5me8qu5s
      @user-sx5me8qu5s 6 ปีที่แล้ว +10

      Looks neat and organised, BUt impractical. Depends on what you would prioritize

    • @icantthinkofausername8964
      @icantthinkofausername8964 6 ปีที่แล้ว +25

      It looks neat but this is a college library so a lot of students will be annoyed because they can't find their book because they don't know the height.

  • @haphuongle2920
    @haphuongle2920 ปีที่แล้ว

    This helped me file students' tests and workbooks. (Each is named by subjectn student's name, and number).
    The one who worked there for a year was surprised that I finished sorting before him.

  • @torstenaan
    @torstenaan 2 ปีที่แล้ว +7

    This was my job when I was a student. In reality it depends on our how much space you got to work with, but none of these algorithms will work. I would find different sorting criterias like first letter, and split them into smaller piles, and add one more criterias until each pile is around 5-10 books, so the small partitions can be sorted and merged. We had around 200 books at a time, and it would take around 30 mins. Most others would just take one book at a time and place it on another cart. It would take them around 2 hours.

  • @jxnx19
    @jxnx19 7 ปีที่แล้ว +31

    As the daughter of a librarian, and someone who helps organize books all the time, I find the quickest way to sort is to look for all the a's, b's, c's, so on. I don't know how effective this would be with that many books, but I do around 10-30 books at a time with this method. If it's the decimal system though, i section off each by their whole number than organize them in each section using the decimal. I then combine them again.

    • @ZotWhispers
      @ZotWhispers 7 ปีที่แล้ว +10

      You are right! I believe the quickest way to do this is the way you described. In Computer Science terms (like Insertion Sort or Quick Sort) is Bucket Sort. You create "Buckets" of the books, and in this case we'd use A, B, C, etc. Then you can either repeat this process indefinitely within each bucket (for multiples) or decide to do an easier sort like the ones described to finish the smaller buckets off.

    • @pvzjames923
      @pvzjames923 7 ปีที่แล้ว +3

      You have rediscovered a piece of computer science, bucket sort. QuickSort takes O(n log n) time, while Bucket Sort takes O(n+k) time; n being # of books and k being the number of significant bits, being 26 in this case

    • @zionj104
      @zionj104 6 ปีที่แล้ว +1

      You have discovered bucket sort. It actually requires fewer and fewer comparisons relative to quick sort the larger the data set is.

  • @The_Rising_Dragon
    @The_Rising_Dragon 4 ปีที่แล้ว +590

    Yeah... Believe me, NOBODY comes to issue books the first few days from the library.
    The Newbies are too busy getting lost,
    The Oldies are too busy catching up, &
    The Procastinators are getting a visit from their friendly neighbourhood Panic Monster!

    • @thegodguy925
      @thegodguy925 4 ปีที่แล้ว +15

      Im seeing the panic monster right now

    • @lythd
      @lythd 4 ปีที่แล้ว +8

      lol i saw that video XD

    • @NetheriteMiner
      @NetheriteMiner 4 ปีที่แล้ว +12

      _references intensifies_

    • @TheEnderLeader1
      @TheEnderLeader1 4 ปีที่แล้ว +2

      Anyone reading this who doesn't know the panic monster?
      Great, you're one of today's lucky 10,000!

    • @helper_bot
      @helper_bot 4 ปีที่แล้ว +11

      @@TheEnderLeader1 was a reference to another TED talk titled "what's inside a brain of a procrastinator" i believe

  • @ber2996
    @ber2996 3 ปีที่แล้ว +5

    imagine using insertion sort with a list of books that is sorted in reverse, you'll end up just comparing all books and consuming the same amount of time as bubble sort, well it was the worst case scenario for insertion sort that's why insertion sort speed still varies with how the list is arranged, overall still better than bubble sort since bubble sort's speed is fixed.

  • @clairecelestin8437
    @clairecelestin8437 ปีที่แล้ว +2

    As a computer science major who was at one time an assistant manager at Blockbuster, I tried getting the employees to do quicksort on a pile of about 700 movies. In practice, swapping movies is the slow part, comparisons are basically free, and keeping track of your partition entries is easy for a computer but hard for a human. Insert sort ends up being better for humans for anything except an extreme example.

  • @krystelle3521
    @krystelle3521 7 ปีที่แล้ว +53

    this is my strategy: just separate them in letters and sort it out.

    • @razorIaIa
      @razorIaIa 7 ปีที่แล้ว +17

      thats called bucket sort.

    • @valeriamartinez3396
      @valeriamartinez3396 7 ปีที่แล้ว

      likrmoge😂😆😆😆🤔😥😣😏😏🙄😶😑😐😙😚☺🙂🤗😇🤔😗😘😍😎😎😋😊😉😆😅😅😃😃😋😂😁😀😀😚😚😚😚😚😚😚😚😚😚😚😚😚😚😙😙😙😙😙😙😙😙😙😚😶

    • @penisdestroyer619
      @penisdestroyer619 7 ปีที่แล้ว

      my method is: call the freshmen for doing it
      its called being a lazy b****

    • @BigGamer2525
      @BigGamer2525 7 ปีที่แล้ว +3

      That's called radix sort

  • @legendp2011
    @legendp2011 7 ปีที่แล้ว +174

    right click, sort alphabetically. done.
    And yes I know they are talking about physical books in the video. but digital books and the new kindles work great (the old kindles may have turned some off)

    • @tsukuyomin
      @tsukuyomin 7 ปีที่แล้ว +16

      legendp2011
      0:22 "the automatic sorting system is broken"

    • @legendp2011
      @legendp2011 7 ปีที่แล้ว +4

      I was just making a joke about how physical books can be dated, when organizing your books is a million times faster on a computer. This scenario isn't important though, it is just an example for a way of thinking they want to demonstrate, so they used this as an example. I made a joke about the scenario, but I understand the scenario isn't what the video is REALLY about

    • @tsukuyomin
      @tsukuyomin 7 ปีที่แล้ว +1

      legendp2011 and I knew that was what you meant.

    • @minchulkim87
      @minchulkim87 7 ปีที่แล้ว +14

      The point of the video is to demonstrate how the computer algorithm does the sorting. Physical or not, the same principle applies.

    • @legendp2011
      @legendp2011 7 ปีที่แล้ว

      Min-Chul Kim I know, read my reply above. I was just joking around

  • @jisoo1571
    @jisoo1571 4 ปีที่แล้ว +1

    I think about this video every week for some reason.

  • @JohnDlugosz
    @JohnDlugosz 2 ปีที่แล้ว

    I've actually applied my Computer Science knowledge of sorting to real-world tasks, in a summer job right after high school at an insurance company. Of note were two tasks:
    First were small (about a quarter of a standard sheet of paper) summary sheets torn from a printed packet, which had to be filed in drawers. The paper was also very thin (it was used with carbon paper to print multiple copies) and did not slide against other sheets well. It was impossible to "square up" a stack of them by tapping the edges against a table, for example.
    The other task was sorting check stubs, by number.
    There are two aspects: the comparisons, and the handling of the physical records.
    For the thin paper index cards, it was easier to insert into the drawers if the stack was sorted first. Then, finding the next location to insert was just a little ways down in the same drawer, rather than being a random location. To sort these, I started with a merge sort technique and evolved it. I sorted as many as was easy to do "in hand" using insertion sort, keeping them spread out and separated with my fingers in one hand. Often it was more than just three or four because I'd have cards that went before the first or after the last already in hand. When that got to be too much effort, I made that one packet and started over. These were my initial groups for the merge sort, rather than just starting with pairs.
    For the check stubs, I used a work table and did a radix sort. It looked like playing solitaire! But I was able to sort them so much faster than had been done by anyone else. They were not interested in having my teach others how to do it; rather, I was stuck with that job for the summer.
    In software, you still have to look at two dimensions to the sorting efficiency: the cost of a comparison and the cost of a swap.
    For the book example, I think a real person, without knowledge of Algorithms and Complexity Theory, would start by pulling all the "A"s into a bin, then taking those to a different area and sorting them using an insertion sort where you don't compare against every element one by one but jump the the correct position: more like the software binary search rather than sequential search; and inserting would push all the books along at one go rather than moving them one by one.
    Then repeat with the "B" titles, etc.

  • @huangxiaofeng3448
    @huangxiaofeng3448 5 ปีที่แล้ว +6

    I love it when I watch it again after learning sorting algorithms, as I finally know what the video was talking about.

  • @Trilioh
    @Trilioh 7 ปีที่แล้ว +75

    If we consider book names are finite strings, couldn't we use Bucket/Radix sort for even faster results?

    • @vincentpol
      @vincentpol 7 ปีที่แล้ว +39

      I think the point of the video was to explain the basics of computer sorting algorithms, which it does well. I don't think it wanted to teach the most efficient algorithm we've got so far. Just the kind of limitations you have to face (ex: compare 1 book to another, 1 at a time, instead of being able to visually identify group of books in 1 look).

    • @danielgehring7437
      @danielgehring7437 7 ปีที่แล้ว +6

      Trilioh
      Bucket sort would compute faster but requires vastly more processing (in the example, space) to come to the same result. I think, as the other person intimated, that the subroutines inherent to a bucket sort are just beyond the scope of the example.

    • @danielchoo2672
      @danielchoo2672 6 ปีที่แล้ว

      Bucket has WC complexity O(N^2), radix is slower for log2 N < log10 max value, which will be true as number of books exceed 10^26 so quick is kinda general case. but yea for this radix is faster

  • @maruthuk
    @maruthuk 10 หลายเดือนก่อน

    Excellent, explained multiple sorting algorithms with their pros and cons (iterations) through a real life example. 👍

  • @megandenison6503
    @megandenison6503 4 ปีที่แล้ว

    I just got a bunch of color sample chips that have number codes. I used the last method to organize them and it made the process a lot faster.

  • @lestranged
    @lestranged 7 ปีที่แล้ว +95

    Why aren't the books organized by subject?

    • @justadude4938
      @justadude4938 7 ปีที่แล้ว +6

      lestrange Maybe they're fiction?

    • @scruffylittlecloud5548
      @scruffylittlecloud5548 7 ปีที่แล้ว +1

      Jeremy Downey then why would you sort them for the next day? No kid would go to the library on their FIRST day of school.

    • @silverrraven5349
      @silverrraven5349 7 ปีที่แล้ว

      Good point

    • @jaxbookcomments4001
      @jaxbookcomments4001 7 ปีที่แล้ว

      At the library I volunteer at it's done by genre then alphabetized for fiction.

    • @BosonCollider
      @BosonCollider 7 ปีที่แล้ว

      Even if you sort them by subject, you will still want to alphabetize them.

  • @szeartur4813
    @szeartur4813 5 ปีที่แล้ว +34

    You also can use radix sort

    • @andycheng4436
      @andycheng4436 5 ปีที่แล้ว +8

      Artur Der Große
      everyone gangsta until the librarian starts getting 10 hands

    • @42scientist
      @42scientist 4 ปีที่แล้ว

      Henry Guerra
      There are plenty of videos explaining radix sort, also known as « bucket sort ». Go look some of them up :p

    • @ahmetbcakici
      @ahmetbcakici 4 ปีที่แล้ว

      you should sort them by their letters so there is no any number then how will do you use radix sort ?

    • @coffeedude
      @coffeedude 4 ปีที่แล้ว

      @@ahmetbcakici You assign a number to each letter in alphabetical order

    • @CalculatedRiskAK
      @CalculatedRiskAK 4 ปีที่แล้ว +1

      @@42scientist Radix Sort is not exactly Bucket Sort. They both are a non-comparison distribution sort, but the way they go about sorting is not exactly the same.

  • @keekeeko
    @keekeeko 3 ปีที่แล้ว +1

    as someone who works in a library and has to alphabetize hundreds of books per week it is absolutely DELIGHTFUL to realize that the system i've developed for myself is a real method with an actual name, and is the most efficient way to do it. bless! how have i never watched this video before!!

  • @u2blr
    @u2blr 2 ปีที่แล้ว

    This is a fantastic way to visual different shorting algorithm

  • @laki74
    @laki74 7 ปีที่แล้ว +84

    Why not just go along the line and take out all the A's and put them all in a pile? Then do the same with the other letters and put them all in their respective piles. When that is finished, you then alphabetize the piles.

    • @SKyrim190
      @SKyrim190 7 ปีที่แล้ว +58

      laki74 congrats, you are now using bucket sort

    • @snazzysnake5051
      @snazzysnake5051 7 ปีที่แล้ว +3

      Luiz Sarchis is bucket sort effective?

    • @chipkennedy9301
      @chipkennedy9301 7 ปีที่แล้ว +30

      Jarvis-Gaming yes bucket sort is more efficient than quick sort, especially with large data sets. But in terms of computer science, it's a different concept than the sorting methods listed here

    • @ManduoDong
      @ManduoDong 7 ปีที่แล้ว +4

      Yes, this way is more efficient. O(N) vs O(NlogN)

    • @yassinzakar
      @yassinzakar 7 ปีที่แล้ว +1

      merge sort worst case , average and best case is O(NlogN) .while quick sort worst case is n^2.

  • @nicekid76
    @nicekid76 7 ปีที่แล้ว +303

    why not be like Tom Sawyer and just make some freshman do it! Convince them it's a game

    • @DemonLilyYT
      @DemonLilyYT 7 ปีที่แล้ว +16

      nicekid76 so now it just takes O(1). World best algorithm.

    • @kaidatong1704
      @kaidatong1704 7 ปีที่แล้ว

      +ParfaitEtrangerLive there's one in Bungou Stray Dogs... along with tons of other book titles.

    • @Bluedragon2513
      @Bluedragon2513 7 ปีที่แล้ว

      Kaida Tong BUNGOU STRAY DOGS

    • @commoncoolchannel8588
      @commoncoolchannel8588 7 ปีที่แล้ว +1

      :D! You've read it as well!

  • @chaosinsurgency884
    @chaosinsurgency884 2 ปีที่แล้ว +1

    Partition with M and N at the same time, as one book (M on left, N on right) since M and N are the 2 middle letters of the alphabet.

  • @heimskr2881
    @heimskr2881 5 ปีที่แล้ว +405

    i thought bogo sort would be the best answer

    • @GewelReal
      @GewelReal 5 ปีที่แล้ว +1

      1 day...

    • @cooliofoolio
      @cooliofoolio 5 ปีที่แล้ว +2

      *300,000,000....

    • @rubberd6cky
      @rubberd6cky 5 ปีที่แล้ว +4

      how does bogo sort even work tho

    • @GewelReal
      @GewelReal 5 ปีที่แล้ว +53

      @@rubberd6cky it sets all things randomly. If all things are in order - it's done. If not, it does the same thing - put things randomly in places. It goes on until all thing are sorted out. It's the fastest yet the slowest sorting method. All depends on "luck"
      Sorry for eng

    • @rubberd6cky
      @rubberd6cky 5 ปีที่แล้ว +3

      @@GewelReal ok thanks, your english is perfectly fine kskskskd

  • @michaelpressley6833
    @michaelpressley6833 7 ปีที่แล้ว +30

    I would use the roy g biv method to sort those books.

  • @youcan_change_handle_3june_
    @youcan_change_handle_3june_ 3 ปีที่แล้ว

    reminds me of animal riddle
    less sorting needed in the middle (differation?) and more resorting in the beginning.
    i think its similar to permutations laws.

  • @itachiswill5263
    @itachiswill5263 4 ปีที่แล้ว

    This was in fact a lesson worth sharing

  • @nilaksh007
    @nilaksh007 5 ปีที่แล้ว +439

    This is flawed. Those sorting algorithms are based on the fact that a computer can only compare two things at a time. But we can compare many more things at once.
    I don't need to compare an A with all other letters to know that it comes first. I know that A is first. Of course I still need to compare books that start with A

    • @Hmuk09
      @Hmuk09 5 ปีที่แล้ว +57

      Nilaksh Singh the thing is even computer can divide everything by letters and then sort out each part. This is called bucket sort. The authors of video just used bad example.

    • @MoonarEclipse
      @MoonarEclipse 5 ปีที่แล้ว +5

      BUT... usually a sorting algorithm is going to be working with numbers.

    • @ryantuckerman2356
      @ryantuckerman2356 5 ปีที่แล้ว +27

      Your method is just as flawed. You assume that you know the nature of the distribution of the books and that they will fit into your predetermined buckets (A-Z). What if all titles started with A. Your first pass of 1280 comparisons would be a waste of time (it would put all titles in the A bucket). So whilst a choosing a random book as the first partition still carries the risk of it being the first or last in order, random start lets the nature of the distribution decide where the partitions are.

    • @Hmuk09
      @Hmuk09 5 ปีที่แล้ว +16

      Stinger Tuck so what? You can continue using bucket distributing till the end. The time will be linear to the total number of letters anyway.

    • @Hmuk09
      @Hmuk09 5 ปีที่แล้ว +8

      Stinger Tuck I'm not talking about qsort modification. I'm talking about another sorting algorithm that's based not on comparison's but on counting. Google up "bucket sort".

  • @margus6052
    @margus6052 7 ปีที่แล้ว +53

    For sorting books *Bucket Sort* would be 3 times quicker than Quicksort.
    Bucket sort in this case would mean that you first sort books to different piles based on their first 1 or 2 letters and then you sort those new groups individually. In this case Bucketsort would take you 4096* seconds
    *1280+ (22 x 128) = 4096 secons. That would be 1.1 hours.. 3 times quicker than quicksort

    • @margustoo
      @margustoo 7 ปีที่แล้ว +4

      Good to see that someone shares same ideas :)

    • @chickeyy1792
      @chickeyy1792 7 ปีที่แล้ว +1

      You know I don't get much of this but I've read many methods from the video and the comments and bucket sort really seems like the most logical algorithm to go with

    • @vincentpol
      @vincentpol 7 ปีที่แล้ว +11

      Bucket sort would definitely be the best algorithm. You can even speed it up by having multiple people each sort a subset of the pile of books and then merge them asynchronously.

    • @3rdfloatingrock
      @3rdfloatingrock 7 ปีที่แล้ว

      Margus T i was thinking the same thing

    • @joseph-fernando-piano
      @joseph-fernando-piano 7 ปีที่แล้ว +1

      Yeah the first thing I thought when I saw this problem was, "well, first I would go through and pull out all the A's, then the B's, etc., and sort those separately"... sounds way simpler just in the explanation alone

  • @GabrielsEpicLifeofGoals
    @GabrielsEpicLifeofGoals ปีที่แล้ว

    Radix MSL sort:
    Group all books into piles where each pile contains a book with a title that begins with "A", "B", "C", ... Then, group each group into sub groups, this time alphabetizing the second letter. Keep moving letters until the full titles are covered.

  • @Yutaro-Yoshii
    @Yutaro-Yoshii ปีที่แล้ว +1

    I'd personally use base 26 iterative bucket sort. It's easier for human mind do recognize if each letters match as opposed to comparing whether K is larger than H. It should result in nlogn performance as well.

  • @ryashaswinisree7254
    @ryashaswinisree7254 4 ปีที่แล้ว +9

    I have an 80 mark test comprising of 7 chapters in biology tomorrow and here I am learning how to sort my books in alphabetical order. Thank you Ted Ed.

  • @guillermorelobalopez7553
    @guillermorelobalopez7553 7 ปีที่แล้ว +103

    Well if you are a computer then ok, do quicksort, but a human can predict where the book will be more or less, making an informed insertion sort... with very few comparisons. Computers have to use quicksort because the processor is a very fast-working stupid.

    • @doctorwhouse3881
      @doctorwhouse3881 5 ปีที่แล้ว +4

      To be fair, with the right algorithm a computer can do much better than quicksort. Quicksort is great for completely random sets, but book titles /aren't/ random so there's various heuristics that can, for average book collections, greatly cut down times.

    • @GewelReal
      @GewelReal 5 ปีที่แล้ว +2

      @@doctorwhouse3881 counting sort?

    • @Henrix1998
      @Henrix1998 5 ปีที่แล้ว

      @@doctorwhouse3881 And giving the computer info about alphabets it can just divide the books into separate lists and sort them even with primitive sorting methods really fast

    • @lasphynge8001
      @lasphynge8001 5 ปีที่แล้ว +5

      Well, the video presents this problem in a context where it's specifically stated that the automatic system is down. But really, for humans, it's totally ridiculous to compare and swap books 2 by 2 when you could just *insert* the book you're holding where it belongs in the part of the line you have already sorted and in which you already know what is where ("insertion" is the method's frikkin' name !)
      I really don't get what they intended to do here, either they shouldn't have set up this whole "automatic system is down" context and presented it as plain computer logic, or they should have presented the insertion method the proper human way.

  • @jp4431
    @jp4431 4 ปีที่แล้ว +20

    "The automatic sorting system is broken"
    Of course it is

  • @heyitzrane3025
    @heyitzrane3025 4 ปีที่แล้ว +7

    Can you make a video/series where you explain different sorting algorithms like Select Sort, Radix Sort, etc., without making it too hard to understand?

    • @marcusscience23
      @marcusscience23 ปีที่แล้ว +1

      Radix Sort is just sorting the books by first letter, then second, then third etc.

  • @johntumahab323
    @johntumahab323 7 ปีที่แล้ว +6

    Bonus Information: Mergesort is about as useful as Quicksort, but can't be done "in place" easily, hurting memory. Still, whenever you use a method on your computer that sorts, it's likely using Quicksort.
    Also as a bonus...all these are examples of sorting in a "state machine". Obviously a human could do it much faster because humans are not state machines. I believe there's a mathematical proof somewhere that demonstrates it is impossible to sort in this sort of situation (i.e. a comparison sort) more efficiently than in an x * ln x algorithim, where x is the number of items (and the complexity of Quicksort).
    But as someone noted below, Radix Sort is faster but only works on certain data types (i.e. non-comparison sort).