3. Sets and Sorting

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

Комментарии • 100

  • @adamhaney9447
    @adamhaney9447 3 года назад +113

    This dude is simultaneously the most excited and patient professor in the world. It's awesome.

  • @ParthPatel-vj2zv
    @ParthPatel-vj2zv 3 года назад +140

    0:00 intro
    3:13 set interface
    8:55 unsorted array
    14:05 sorted array
    18:48 sorting vocab
    21:28 purmutation sort
    26:04 selection sort
    40:52 insertion sort (skipped)
    41:25 merge sort

  • @kyoungjunhan1098
    @kyoungjunhan1098 2 года назад +21

    All hail MIT for their selfless determination to contribute to our society.. for free!

  • @natura-g5i
    @natura-g5i 3 года назад +109

    He didn’t stop smilling the whole lecture 😳

    • @sam_s3344
      @sam_s3344 3 года назад +24

      He seems so happy :) We need more such professors!

    • @vectoralphaSec
      @vectoralphaSec 2 года назад +17

      That's good. That means he loves what he does.

    • @erickgomez7775
      @erickgomez7775 2 года назад +1

      Yeah... That's why I was so calmed when. I watched this video

    • @likeabed
      @likeabed Год назад

      哈哈哈哈you’re right

    • @scatteringparameters.4167
      @scatteringparameters.4167 Месяц назад

      He depressed.

  • @arizavala5297
    @arizavala5297 Год назад +9

    The 3 instructors are just great. Good class as well.

  • @JeffreyConcerto
    @JeffreyConcerto 3 года назад +22

    Love that MIT is providing this to us for free. Thank you! The lecturer is passionate and knows his stuff, but the previous lecturer from Day 2 was far superior. The students would probably benefit more if he taught the entire course.

    • @xintu8123
      @xintu8123 3 года назад +1

      yeah, previous one is much better, and much more comforting

    • @quanting
      @quanting 3 года назад +1

      This lecturer's math is better - more rigorous.

    • @goldibollocks
      @goldibollocks 3 года назад +2

      I love his enthusiasm but also love the guy from day 2!

    • @bavidlynx3409
      @bavidlynx3409 2 года назад

      That guy is a genius.

  • @textinface1
    @textinface1 Год назад +15

    So far my favorite lecturer. Really engaging and easy to follow

  • @ram_bam
    @ram_bam 3 года назад +26

    Justin is a fantastic lecturer.

  • @yevhendubinin
    @yevhendubinin Год назад +7

    Entire 6.006 course recordings makes me wanna go back to university and study cs again

  • @sweeteshsingh4054
    @sweeteshsingh4054 3 года назад +28

    At minute 41.07, by mistake professor mentions Insertion sort runs in O(n) time, it should have been O(n^2). I know it was human mistake, can happen with anyone.

  • @dn275
    @dn275 3 года назад +7

    Great lecture Justin, you have a great vibe about you. The quiet students in the class makes it all funnier to me. Feels bad Justin haha

  • @lucaswolf9445
    @lucaswolf9445 3 года назад +14

    I was slightly confused at ~ 13:30: Inserting a new element (at the end) should take Theta(1) amortized time (and not O(n) amortized time, as the instructor suggested). However, since we have to search through the entire dyn. array on every insert to check if an element with that key already exists, the insert operation runs in O(n).

    • @anhquantranle961
      @anhquantranle961 3 года назад

      Agree with you.

    • @izreeljames7953
      @izreeljames7953 2 года назад +2

      @Lucas keep in mind the professor's response is relative to the argument he gave earlier in the lesson of traversing, one by one, through an array of size n to find(k), and that would take order n time.

  • @daydreamed
    @daydreamed 3 года назад +5

    Thanks for the update. Really helpful resource

  • @srijanshashwat2434
    @srijanshashwat2434 3 года назад +4

    This is really deep, like deep learning deep - Justin Solomon

  • @ZMan-lx6pg
    @ZMan-lx6pg 7 месяцев назад

    Watching it online it feels like why isn't anyone answering what the Professor asks, but even if I would have been sitting in the class, I would not have answered thinking someone else would. But that made it hard for the Professor.

  • @offYears
    @offYears Месяц назад

    what is meant by the remark at 9:20 about the previous two lectures using 'metaphorical arrays'? is this refering to the 'memory allocation model' described by Demaine in L02?

  • @surajagarwal3561
    @surajagarwal3561 3 года назад +3

    Very helpful thanks mit love from india 🔥🔥

  • @ted3309
    @ted3309 2 года назад +5

    The way that nobody answers his questions makes me sad, honestly. He's doing his best to give you some knowledge and you can't even say if 72 larger than 8.

    • @photographyraptor
      @photographyraptor 2 месяца назад

      why is he asking 3rd grade questions though, who's going to raise their hand for that in uni

  • @pictureus
    @pictureus Год назад

    Why do we always seem to go backwards(?); why not just push to the array and when the length reaches the size we stop?
    Is it's because it's easier to make inductions on where we anyway need(?) to be explicit about the index and don't want to make assumptions about the underlying datastructure?

  • @CairoQuinn
    @CairoQuinn 2 года назад +1

    he really wasn't kidding about the serial killer handwriting

  • @Juan-dc6yf
    @Juan-dc6yf Год назад

    Goat lecturer

  • @nirbhaysingh4360
    @nirbhaysingh4360 3 года назад +13

    I feel bad when the students are not responding, lol 😅

    • @JeffreyConcerto
      @JeffreyConcerto 3 года назад +8

      It's because he wasn't doing a good job engaging the students and having them follow his thought progression, so many had tuned out and/or weren't understanding him. It didn't help that he basically dismissed any questions they had so that he could cram as much material as possible into the time he was allotted.

  • @b088mohdzaid5
    @b088mohdzaid5 Год назад +2

    Yes, that’s true that this teacher is not able to share his ideas throughout his lectures and can’t able to connect with them

  • @fitnesscliffs1602
    @fitnesscliffs1602 3 года назад +1

    why are we doing comparison/merges in reverse order for selection and merge sort? what's the point?

  • @SphereofTime
    @SphereofTime 5 месяцев назад

    5:16 set is a container

  • @frederickgriffth4431
    @frederickgriffth4431 4 месяца назад

    I'm confused about the merge sort code. Does it not seem to have added the i term of L/the j term of R into the set A? It only made the A[b-1] = L[j-1] or R[j-1], but there's no statement to assign L[i] or R[j] to the A[b]. This is my confusion, maybe it's fault.

  • @Namu400
    @Namu400 Год назад

    Very easy to understand

  • @shaileshkumpawat6913
    @shaileshkumpawat6913 2 года назад +3

    can i watch these lectures and try to write code in C++ instead of Python? I mean I can but is it a good idea to learn both C++ and Algorithms, and is it feasible?

    • @mitocw
      @mitocw  2 года назад +33

      You can but we would advise you look for a course that is in C++ and save yourself some extra effort. If you still want to do this course, it is possible. The logic and the algorithms will work for almost any programming language. Things to look out for:
      - C++ is statically typed vs Python which is dynamically typed.
      - Python Functions do not have restrictions on the type of the type of its return value. C++ does have restrictions. C++ can only return a type of value which is already defined.
      - Python variable scope is more flexible than C++. Look out for issues of scope in things like loops.
      Best wishes on your studies!

  • @KlanBr1
    @KlanBr1 Год назад

    you are not counting your students here in youtube around the world. Greetings from Argentina. Sorry for my english , i'm not very good with the sintax

  • @omarh7l193
    @omarh7l193 4 месяца назад

    sorry but can someone tell me in 25:00 why does the loop starts from 1 not 0 ?

    • @LiamLagan
      @LiamLagan 3 месяца назад +2

      He has chosen to write pseudocode with 1-Based Indexing, in which you access the first element of the array like this: array[1]. If you are used to 0-Based Indexing, the loop would be for i from 0 to length(array) - 2. Note the use of -2 rather than -1, we don't need to visit the last element, as there wouldn't be anything to compare it with.

  • @howardzhu2298
    @howardzhu2298 2 года назад

    Very nice ocw!

  • @ting9252
    @ting9252 2 года назад

    question: what does Eric post on Facebook?

  • @jackmiller9829
    @jackmiller9829 2 года назад

    thank you mit

  • @ScientistShield01
    @ScientistShield01 7 месяцев назад

    thanks mit

  • @Reyxxvii
    @Reyxxvii Год назад +1

    I didn't know James Murray taught at MIT!

  • @mahmoudadel8313
    @mahmoudadel8313 2 года назад

    first thanks for amazing course but there something wrong here when prof explained selection sort i reconized it doesn't a selection sort ti's a abubble sort please correct me if am wrong

  • @kenfuliang
    @kenfuliang 2 года назад +1

    thank you ~

  • @lucifyer4486
    @lucifyer4486 3 года назад

    Thank you! Great content!

  • @webdevelopmentwithjavascri8020
    @webdevelopmentwithjavascri8020 3 года назад

    Thanks MIT

  • @paulhetherington3854
    @paulhetherington3854 2 года назад

    Hence; itt doesn't collect - because; you load out!

  • @rohan30497
    @rohan30497 2 года назад +3

    MIT should limit the number of instructors taking a course. Like 3 proffs for a DSA course, it does affect the synchronization between the students n the proffs. Btw, loved Erik and Jason, Justin is just trying to cover too many stuffs in too less time.

  • @kentsang9376
    @kentsang9376 3 года назад +3

    I like his vibe

  • @dipeshshrestha7287
    @dipeshshrestha7287 2 года назад

    could anyone help me with the recitation 2 followed by exercise where Set from Sequence has to be built? I am not getting the part self.S.get_at(i).key inside the insert method. What kinds of items are we feeding to build the sequence seq() and later set from seq? Are we making custom item object with key attribute as intrinsic property? Please help me with this.

  • @hokkaido1114
    @hokkaido1114 Год назад

    37:34から

  • @balletvaria
    @balletvaria 3 года назад +1

    All the teachers are good

  • @abdomostafa9844
    @abdomostafa9844 2 года назад

    Are Lec pdf is avilable ?

    • @mitocw
      @mitocw  2 года назад

      Yes, lecture notes and other course materials are available on MIT OpenCourseWare at: ocw.mit.edu/6-006S20. Best wishes on your studies!

  • @kevinquiroscanales6240
    @kevinquiroscanales6240 Год назад

    Nice lecture. I wonder why he doesn't use the number 8 in any of his examples. haha

  • @ganeshanageshappa9341
    @ganeshanageshappa9341 3 года назад +6

    Start watching at 2x speed.

    • @thinkGrey_
      @thinkGrey_ 3 года назад +1

      Obviously

    • @jianxinhuang2465
      @jianxinhuang2465 3 года назад +2

      Oh, I thought I have open 2x speed in the beginning!

  • @nanunsaram
    @nanunsaram 2 года назад

    Great!

  • @LordMoopCow
    @LordMoopCow 3 года назад +1

    This guy said hella

  • @rstark
    @rstark 3 года назад

    Awesome

  • @krizh289
    @krizh289 2 года назад +1

    Anyone else get confused by the mathematical part?

    • @seyitilkturk
      @seyitilkturk Год назад +2

      Check discrete math, which is essential for learning algorithms.

    • @malikaremu2344
      @malikaremu2344 Год назад

      not like he reaaly needs it@@seyitilkturk

  • @malikaremu2344
    @malikaremu2344 Год назад +2

    this class is so non interactive

  • @skidipap8750
    @skidipap8750 10 месяцев назад

    who else is preparing for job interview

  • @kevinzebb
    @kevinzebb Год назад

    Imagine paying to go to MIT and the professors can’t be bothered to write properly/legibly

  • @photographyraptor
    @photographyraptor 2 месяца назад

    dude wastes so much time with rhetorical 3rd grade questions and decent jokes, but doesn't have time for student questions. he seems like a really sweet guy, but the time economy is terrible.

    • @mitocw
      @mitocw  2 месяца назад

      Keep in mind, courses like this have recitation sessions where students can ask questions for clarification.

  • @alute5532
    @alute5532 3 года назад +1

    24:53 Omega question
    To answer it you gave to stop listening to wanna bes and go bVk to source math
    Omega is a probability space
    a set of all possible outcomes
    Set of all possible moves which he chose from his algorithm
    From comments I'd say this is only mediocre
    Stop whatever you're doing only when you're ready study probability theory for phds
    God wish Caltech picks me up for a professor Substitute for once
    Sorry MIT but my heart is in California

    • @undefinedundefined7942
      @undefinedundefined7942 2 года назад +1

      Nope same symbol but different meaning. They're talking about algorithm complexity / big-O notation so it's not the same as the probability one

    • @SwatejTech
      @SwatejTech Год назад

      You clearly don't understand what the Omega notation is in Algorithms.

  • @ashishbhandari8792
    @ashishbhandari8792 3 года назад

    Done!!

  • @louiss3409
    @louiss3409 3 года назад

    Wow, I understood this, I even wrote code that did this three years ago, yet my applications which included samples of the code to Google and Amazon went unanswered and I never got into MIT. It is almost like they circumvented the security of my system.

  • @karthikKarthik-by6ws
    @karthikKarthik-by6ws 2 года назад

    my comment is the 47th comment

  • @amansagar4948
    @amansagar4948 3 года назад +4

    watching these lectures, the moment you think you're perhaps understanding the class better than the folks sitting there at freaking MIT, actually you're right, you're actually smart if you're doing this. these schools selection process is as useless as Guinness world record, not enough participate at the right time at the right age, it's like first come first serve

    • @sam_s3344
      @sam_s3344 3 года назад +1

      First come first serve basis? I wanna research more on this now. Your comment helped me realize all this. Thank you!

    • @davyroger3773
      @davyroger3773 3 года назад +5

      But how can you know that you understand the content better than the students? Because they dont speak up? Have you considered the other factors involved in that other than ignorance?

    • @Guinhulol
      @Guinhulol 2 года назад +1

      Well, you are way over your head there, buddy! We are all smart, I will give you that, however, watch an RUclips video in the comfort of you home is a whole different experience than actually being present in class along with 200 students.

    • @BohdanIvanov-ru7qg
      @BohdanIvanov-ru7qg 3 месяца назад

      @@davyroger3773 You don't get it bro. This guy is smarter than all these MIT students because he can bark that 9 is a larger number than 7 on command.

  • @alzubismog3891
    @alzubismog3891 2 года назад +2

    I'm not sure if that student really know what he doing, great subject with worst explanation, Thank you for wasting my time.

  • @akoravani5502
    @akoravani5502 3 года назад +1

    First😂

  • @paulhetherington3854
    @paulhetherington3854 2 года назад

    /mk Xtt' green / black cammoflage 20deg fnt 100pts tempd DllCHaa'(Delta) 4''in x 4''in Att' center 3''in diamsz dbl speres //system.out.ArroW' HeaDD'.prntln("DllCHaa' SDR OrrbTTsz' L'''x system) /