Added: 3 years ago
From: UNSWelearning
Views: 22,309
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (30)

Sign In or Sign Up now to post a comment!
  • Waste of time.

  • I'll follow every lecture he says.

  • Hello Sir; I've beening following ur Lectures on YouTube But I've Gotten Stuck Here on this lecture 9 my compiler is returning an error message : 'SUM' is asigned a value which is never used ? Please help me here my compiler is not recognizing 'n'

  • @Izooify he is not personally seeing the comments now is he

  • As a tack on to my prior statement (I ran out of room). This appears very similar to recursion because in fact it is. If it helps try imagine little Russian dolls in succession and if that helps here is a quote from "Back to the Future":

    "you're not thinking fourth dimensionally"

    Love Victor Cross

  • Dear nateaus.

    This appears very similar to recursion as the function is calling it's self. All though it is true that the function is passing n-1 into its self on the in function call in the new call that is treated the same way as n would be and that is where the increment is happening. The part that allows it not to run infinitely is the if statement at the top of the function searching for when n is o at which point it returns 0 and then terminates the original call and all subsequent calls.

  • @nateaus

    Interesting. I thought recursion when a method calls itself regardless of any counting mechanism.

  • 2 people took fiddling the wrong away and ended up in prison

  • i wish my lecturers were like him

  • microsoft security? i don't get it

  • @intindse Microsoft doesn't too.

  • -Wall or -Wuninitialized will not warn you for uninitialized variables if you do not use -O with them.

  • I only wish he didn't talk so fast

  • man! this guy is good! I wish my uni was like this. here in melbourne most uni's dont have great staff these days, unless you're in the best uni.:(

    Oh well, teaching myself..

  • His shirt, "Microsoft security". Ha.

  • hey im watching these vids out of casual intrest, and ive got a set up which allows me to write and compile my own c programs. i was just wondering if anyone had any tips on how to do the assignment 'bjorn'. i dont understand how to use a recurring function, but get word 'p' printed when number 'p' is inputted. any help would be greatly apreciated. feel free to pm me.

  • Afraid I don't know what is required in the bjorn assignment, but I'll give you an example of what a recurring function is with a function (which I've called recurringFunction for this example) that will repeat a set number of times (from an input value to a variable I'm calling amountRecurring, which you've already learned how to do if you've followed along):

  • Comment removed

  • Comment removed

  • thanks, all that is a great help!

  • Np ^.^

  • Or just press "Ctrl C" to manually break the loop ; ).

  • @Truthiness231 well that's a bit extreme, killing the program works too...

  • @theseriousaccount What nateaus said (while highly compiler dependent) makes more sense, as one can get a look at everything going on before termination. But yeah I just pulled that horrible fail of an example I posted nearly a year ago out; there is a better one in this video. ^.^

  • Actually this is not recursion. Your example is just repeatedly calling a function.

    Recursion is when a function calls itself. But the self-call needs to modify the n value. Eg n-1 or n+1, so each subsequent call modifies the n value and moves closer to the final output. Otherwise there would be an endless loop.

    If you look at 29:43 you will see the function calls itself with but with (n -1).

  • @nateaus In other words, they shouldn't have called the movie inception, they should have called it recursion.

  • Brining a chainsaw to an exam... NOW THATS AN IDEAR

  • they didnt laugh at his mars bar joke!

  • I think he actually wrote all the numbers from 1 to 100, and then all over again backwards under the previous one. He then saw they all added up to 101, multiplied, then divided. So I don't think it was THAT awfully quick, but still rather impressive. That's what it says in this book I'm reading at the moment, called "The Language of Mathematics" by Keith Devlin. Fun read btw. Doesn't teach you math, but it gives you some history and insight. It even scratches topology. Math is damn cool.

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more