Lec 10 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008

Lecture 10: Divide and conquer methods, merge sort, exceptions
Instructors: Prof. Eric Grimson, Prof. John Guttag
View the complete course at: ocw.mit.edu/6-00F08
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu

Пікірлер: 39

  • @englishdeerpark
    @englishdeerpark14 жыл бұрын

    These videos make programming far more interesting and easy to understand than anything else I've tried to learn from. Thank you, MIT.

  • @Stewie111111111
    @Stewie1111111116 жыл бұрын

    17:09 to elaborate on the complexity of each level, the bottom level merging the singleton lists has N/2 steps, it keeps getting larger until the final level with N-1 steps merging the final 2 sorted lists.

  • @georgesadler7830
    @georgesadler78303 жыл бұрын

    This is solid beginning to students majoring in computer science.

  • @sarahbober4167
    @sarahbober41673 жыл бұрын

    Such an incredible professor

  • @rajulisation
    @rajulisation14 жыл бұрын

    @jerricogomez its not a space error..its the indentation of subsequent blocks of code that python forces u to use...to get used to it use good text editors as VIM etc..and google around about vim's python feature...

  • @Maeda_Toshiie
    @Maeda_Toshiie8 жыл бұрын

    Great intro into some basic algorithms in CS. My first course in programming sucked in comparison; we didn't learn anything beyond bubble sort and not even binary search.

  • @aaronaaronaaron5922
    @aaronaaronaaron59225 жыл бұрын

    this course is great!

  • @andyalice6673
    @andyalice66735 жыл бұрын

    very helpful lecture.

  • @heshamwhite
    @heshamwhite14 жыл бұрын

    thank you guys this lecture was great

  • @Twisted_Code
    @Twisted_Code11 жыл бұрын

    KZread's interactive transcript seems to miss on context a little easier than you'd think. for instance, at 30:01 the transcript says "root force..." and the professor had actually said "root force". It also seems to have trouble with one my favorite KZreadr's voice. LOTS of syntax errors in THAT transcript.

  • @luckyranger94
    @luckyranger9413 жыл бұрын

    awesome course and taught in a very way, thanks

  • @ncckdr
    @ncckdr9 жыл бұрын

    that is very great

  • @brunodepaulaassuncao2389
    @brunodepaulaassuncao23896 жыл бұрын

    I have a question. Professor Grimson said, that the exception raised inside the 'getGrades' function wasn't an IOError, but in fact it was an IOError, wasn't it? Because otherwise It wouldn't t raise the error tot the 'try' call. Furthermore, the " 'Could not open', fname " message would only be printed if it got inside of the except clause, which would only happen if the error was specifically an IOError, right? I got a bit confused at this part. Tks

  • @jenkinsj9224

    @jenkinsj9224

    3 жыл бұрын

    Yes, you are totally correct. It was an IOError to begin with.

  • @kopilatis10
    @kopilatis1013 жыл бұрын

    Anyone knows where I can find that handout?

  • @claudiuionel7631
    @claudiuionel763111 жыл бұрын

    1) because of the speed... When I do a simple copy paste in linux I have 31Mb/s... When I do it in windows only 8-9Mb/s... Which one is better? :) 2) you don't have to pay for it, and everything works without drivers (you need to install video drivers for 3D aplications - it does that for you with a click) 3) no viruses 4) you want to play, pay for software use windows / you want speed and not pay every year for antivirus and software use linux :)

  • @denistsoi
    @denistsoi13 жыл бұрын

    @kopilatis10 try checking the OCW website - you might get lucky by findng the prinout there.

  • @usynnstradler
    @usynnstradler12 жыл бұрын

    and environment

  • @speensaba262
    @speensaba26210 жыл бұрын

    Is there anybody who could help me. I have written all the codes i.e def merge() and def mergesort(). But when i run it with test the output gets stuck with merge. I mean it divides but in merge it gives me error says typeerror 'none type'. Cd you please tell me what is the code for list test and def mergesort(test). thank you all

  • @pulprobot5120

    @pulprobot5120

    10 жыл бұрын

    ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-lectures/lecture-10/lec10.pdf Here are all the lines of code for this lecture, hope this helps.

  • @speensaba262

    @speensaba262

    10 жыл бұрын

    thanks u very much sir.

  • @usynnstradler
    @usynnstradler12 жыл бұрын

    windows rocks. macs and linux are very good for programmers because of the interface

  • @MasterFuck3000
    @MasterFuck300012 жыл бұрын

    why is everybody using macs and linux?

  • @brainstormingsharing1309
    @brainstormingsharing13093 жыл бұрын

    👍👍👍👍👍👍👍👍👍

  • @tmn0004676
    @tmn00046769 жыл бұрын

    I could not get this to work. I get the following error. >>> [1, 4, 3, 6, 5, 2, 8, 7] [1, 4, 3, 6] [1, 4] [1] [4] merged [1] [3, 6] [3] [6] merged [3] merged [1] [5, 2, 8, 7] [5, 2] [5] [2] Traceback (most recent call last): File "C:\Python27\mergesort.py", line 36, in mergesort(test) File "C:\Python27\mergesort.py", line 30, in mergesort right = mergesort(L[middle:]) File "C:\Python27\mergesort.py", line 29, in mergesort left = mergesort(L[:middle]) File "C:\Python27\mergesort.py", line 31, in mergesort together = merge(left,right) File "C:\Python27\mergesort.py", line 12, in merge result.append(right[j]) MemoryError Can anybody help?

  • @sunner008

    @sunner008

    6 жыл бұрын

    could you show me the code?

  • @ntwiles
    @ntwiles13 жыл бұрын

    "been a long day".

  • @timfoil740
    @timfoil74013 жыл бұрын

    When I try to do the insert function after I do the create function I get a type error: TypeError: object doesn't support item assignment Can someone please explain what is going wrong?

  • @sepantagh6234

    @sepantagh6234

    5 жыл бұрын

    timfoil740 probably you should update your python

  • @timfoil740

    @timfoil740

    Жыл бұрын

    @@sepantagh6234 thanks that worked

  • @Chiavaccio
    @Chiavaccio2 жыл бұрын

    👍👍

  • @ray13z
    @ray13z12 жыл бұрын

    Macs - coz people have the cash. Linux - cause it's highly-legally-customizable. You can (and are allowed to) practically change each and every damn thing about it (if you want to). Oh and no viruses (in both).

  • @aamirfaridi3783
    @aamirfaridi37835 жыл бұрын

    mit course on visual basic.

  • @aamirfaridi3783
    @aamirfaridi37835 жыл бұрын

    mit course on ms word ms excel ms powerpoint ms access and oracle.

  • @ScionPratik
    @ScionPratik13 жыл бұрын

    great if u dont have much money to study in mit but u can attend classes for free

  • @RichardSmart
    @RichardSmart12 жыл бұрын

    Just watching the whole series from Australia - great lectures. However my classic problem with university was typified at 02:50 - me concentrating hard, hot girl walks by in hot pants, my eyes turn to spirals and I lose concentration for 5 mins. Education should always be on you tube with camera focussed hard in on the lecturer. Its the only way it can be done, certainly for me anyway. Does this constitute a recognised attention deficit disorder I wonder? Sounds flippant but its a real problem