Time complexity analysis - How to calculate running time?

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 259

  • @dragnhuo
    @dragnhuo 10 ปีที่แล้ว +31

    Just like your pointer video, your 11 minutes on time complexity has taught me more than I have learned in a 50 - 75 minute class period. I really appreciate your work. Thanks a ton.

  • @thecuriousone12
    @thecuriousone12 10 ปีที่แล้ว +200

    Thank you so much for these videos! I have my exam in Algorithms in a week and your tutorials are waaaay more helpful than my textbook! Thank you sir!

    • @mycodeschool
      @mycodeschool  10 ปีที่แล้ว +36

      You are most welcome :)

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

      +UnspokenDesirexX what is your textbook is it Intro to algorithms CLRS

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

      Haha, pathetic Jimmy Bryan. People that watch this video are into computer science. They won't click on a random shortened link leading to your so called "hack". I suggest to try on Taylor Swift videos instead.

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

      How was that exam haha

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

      Make sure to reference him lol

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

    Wow... an entire (often unnecessarily complicated) lecture very successfully boiled down to 11 minutes. I'm excited to watch the other videos in your series. Thank you very much for your excellent work!

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

    Explained better in ten minutes than in 3 hours by my University professor. Thank you.

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

    Great job! Over seven years ago, but I can still thank you!

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

    I wish I could add a thousand likes!!!! This deserves a sub asap.
    By 6 min (6:50) I have learnt more than what I have researching all day

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

    HI Malik,
    Line 3 is inside the for loop. The loop is running till n. So, it will be executed times for i= 0 to n-1. Line 4 is the for statement that validates (i

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

    Dude your videos are amazing. Kudos. And I promise i am not trying to be funny , I am being genuine when i say this - your accent is a refreshing breath of fresh air.

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

    Really appreciated your hard work. I read lots of article and books regarding these topics but now i get all the concepts. Your method of explaining is very good. Keep it up

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

    Undoubtedly , the best explanation on Big O, I have ever watched/listened/attained !! A Big thanks for the Big O tutorial !!

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

      can you please explain me the false condition

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

    I'll like to point out one mistake here... in the loop for(i=0 ; i cost is 1 and it runs 1 time
    for i cost is 1 and it runs n+1 times (1 time for the false condition)
    and
    for the increment part;
    i++ is equivalent to i=i+1;
    Therefore, that statement has cost 2,
    and it runs for only n times as the increment is done after the loop runs.
    So it should be 1 + (n+1) +2n and the rest just like you said.
    Hope it was helpful.

    • @jennychen927
      @jennychen927 8 ปีที่แล้ว

      +DHWANIL SHAH I also noticed this mistake. The answer should be 3n+4

    • @SeanFrancisNBallais
      @SeanFrancisNBallais 8 ปีที่แล้ว

      +DHWANIL SHAH I was also thinking the same thing!

    • @nymetfan52490
      @nymetfan52490 8 ปีที่แล้ว

      +DHWANIL SHAH can you please modify your correction so that it goes through each step. For someone new to this, it is much harder to figure out where you are starting/where you changed his response. Specifically, I am not getting how you got 3n. Can you also clarify your corrections in a cleaner manner. I would really appreciate your help! Thanks!

    • @7551dj
      @7551dj 8 ปีที่แล้ว +17

      +financeguy1225 The first point to remember while analyzing for a loop is to check how many times does the loop actually run... In this case, since it is from i=0 to i

    • @sfloam524
      @sfloam524 8 ปีที่แล้ว

      +Dhwanil shah Thanks for the offer, I will do it today! I appreciate it!

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

    This is the best explanation EVER on this topic. And I've tried (almost) all the books, sites etc. Hope I can thank you somehow someday sir!

  • @CiscoASR
    @CiscoASR 8 ปีที่แล้ว

    Really a fantastic job on this topic. None of the instructors at my school come close to explaining these concepts like this guy...

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

      American ?
      yes, I know, you schools are bad ...

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

    Definitely much better English than some of the algorithm videos i have watched. I have a japanese lecturer at uni who is really good, but i don't know what he is saying. lol
    Cheers from Australia.
    P.S. "Algoithm' is pronounced "Al Gore rhythm".
    who said white guys don't have rhythm?

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

      Jitian?

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

      Relatable,our teacher is french and he has a really heavy accent,so he has difficulties with explaining sometimes.

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว +27

    You are most welcome :)

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

    Best programming tutorials!! Very well explained.

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

    Very Good Lecture sir better than any paid course.

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว

    Thanks Melchi. Your request is in queue. There are a lot of requests for C beginner lessons and I am creating them first. After that, I will try to get one on threads.

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

    You did an extremely good job in all your videos... Please make a tutorial explaining Threads in C. If possible pthreads. I would like to understand in terms of how a thread is allocated memory in the stack frame.

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

    Algorithm complexity AND indian accent? Bring it on.

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

      I hope it was "brought on" and the Indian accent worked well for u

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

      If someone has an accent, it just means they speak more than 1 language.
      For example, Einstein spoke (5) languages and had a very thick accent.
      Don't hate of polyglots.

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

      Rod D. you must be fun at parties.. if you go to them.

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

      Don't be stupid you must be fun at any thing else apart from parties .... Unless thats all you do

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

      Someone has to bring the fun in funeral.

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

    just cant stop appreciating the great work that you have done!! Thank you so much.

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

    Okay so firstly, I think that the way you choose to explain concepts is great. I appreciate the conciseness of your phrasing. However, it took me some time to figure out that the word you were saying was "algorithm". While it is less relevant, I think that anyone attempting to explain technical fundamentals of this nature would be wise to ensure that their viewers can understand them.

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

    Your lessons are very presented, the logical representations and visuals really make it easy to understand. These videos are by far the best I have found to learn these concepts! Do you have lessons on Hash tables too somewhere??

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

    I love how he said "behaves" behaaaaves"

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

    a very nice methode,,,,, very simple and too much help full ,,,thanx alot for sharing these videos....

  • @Azhagi-Transliteration-Apps
    @Azhagi-Transliteration-Apps 6 ปีที่แล้ว

    Very good intro. Quite helpful to my son. Thanks a lot.

  • @095_shaniabalkhi9
    @095_shaniabalkhi9 3 ปีที่แล้ว

    This tutorial was so good! 💯

  • @georgr17388
    @georgr17388 10 ปีที่แล้ว

    Thank you so very much for a simple explanation of something very complex. Cheers!

  • @pawan-td6ff
    @pawan-td6ff 6 ปีที่แล้ว +7

    Most accurate pronunciation of 'behaves' I've ever heard

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

    why does the loop consist of only comparison, and increment. Won't the variable 'i' be assigned every time as well?

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

    In your for statement you forgot to add the one more operation, the "hidden" i=i+1 obvisouly takes two operations, if you include the fact that it also checks if (i) is less than n-1 hence the for loop costs 3 operations, plus the initialization ontop, (i=1).

  • @muntazir.manish
    @muntazir.manish 4 ปีที่แล้ว

    Easy to understand! Thanks for the content.

  • @srikanthpb9053
    @srikanthpb9053 8 ปีที่แล้ว

    Excellent videos so far , Please reload a tutorial to elaborate the same tutorial , I am unclear about few things , its on very high level

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

    at 6:18,in "for loop" i is also initialized to 0, so why did nt it take one unit time besides one unit time for comparision and one unit time for increment?

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

      We can say that each time we are doing two things, an assignment first to 0, then to 1 and then to 2 and so on and then a comparison to see if we are less than n-1. So increment in basically assigning the next integer. And anyway, whats important is the number of times the line is getting executed, the constant cost for this line could be 3 also. But finally in time expression, what matters is whether its a function of n or n^2 or n^3 or something else. :)

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

    Thanks for a very brief explanation sir...

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

    I was following everything fine until 7:20 when you introduced the constants...you lost me right there!

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

      Here constant means it will not change it value, it will neither increase nor decrease so function will have no effect with these constant.. The N will define the function...

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

      I also didn't get it the first time, but on rewatching it I got it.
      Its an alternate way of calculating the computational time for the different operations. Doing it the first way you get 4n + 4. Doing it the second way you get cn + c'. Both equations look identical, so it really doesn't matter how you calculate it. He is just trying to get the point across.
      In case you were confused about how he got cn +c'.
      Multiply cost and no of times.
      (c1 x 1) + c2(n + 1) + 2c3(n) + (c4 x1)
      c1 + c2n + c2 + c3n + c4 [he is trying to take things common here to make it simple to understand]
      c1 + c2 + c4 + n(c2 + c3)
      and then he assumed c' =c1+ c2 + c4 and c=c2 +c3
      cn + c'
      In case you were wondering what is c1, c2, c3, c4, they are alternate ways of viewing the cost.
      Next part,
      Tsumofmatrix = an2 + bn + c [I think this is a formula]
      The thing to notice here is Tsumofmatrix is an exponential equation. Therefore he rounds it off to be proportional to n2. Hence O(n2)
      Tsumoflist is a linear equation. Therefore he rounds it off to be proportional to n. Hence O(n)
      Tsum = constant (for all values. See the graph). Therefore it is O(1).
      This is as per my limited understanding of the video.

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

      @@spectaterahul Thanks for your explanation, helped me understand the video better. BTW, 'an^2 + bn + c = 0' is the quadratic equation.

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

      @@spectaterahul Thanks for your explanation. but there's a little glitch on your equation "(c1 x 1) + c2(n + 1) + 2c3(n) + (c4 x1) "
      it should be (c1 x 1) + 2*c2(n + 1) + 2*c3(n) + (c4 x1). By the way no matters what you cover this part in a great extent ! :)

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

    What math theories do I need to understand to comprehend what you are teaching so that I may understand O'Notation? I understand Algebra but I'm not sure where or how you're coming up with the formulas at 7:31 and 8:30
    Thanks for any insight you can give! :)

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

      having the same question. Can some please help!

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

    Thank you. That was nice and clear... I’m going to suggest others watch this.

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

    Why didn`t add cost of i=0 in for loop at 7:26 in video, as you have mentioned 1 unit of time for assignment.

  • @mithunh638
    @mithunh638 9 ปีที่แล้ว

    Perfectly explained. Good lecture..

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

    Your content is really good and the explanation is damn easy .

  • @rajeshdansena
    @rajeshdansena 8 ปีที่แล้ว

    Very precise and clear explanatio. Thanks buddy!

  • @fredrikandersson2515
    @fredrikandersson2515 10 ปีที่แล้ว

    When you are using TSumOfMatrix as an example you say that "a" and "b" are some constants. What might those constants be, exactly? Time?
    Thank you for an excellent video series, by the way!

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

      Fredrik Andersson yes some amount of time (in some unit).

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

    6:46 shouldn't it take one more unit of time for declaration of int i=0??

  • @adityanarayandixit1888
    @adityanarayandixit1888 8 ปีที่แล้ว

    One correction I see,
    at ~ 6:37 , the cost for line 2 won't be 2(n+1), the initialization will happen only once and n+1 times the increment(2 Units) and comparison(1 unit). So for line 2 total time should be: 1+ 3(n+1).

    • @FirstLast-ws7zw
      @FirstLast-ws7zw 8 ปีที่แล้ว

      because i++ means "i+=1/ i = i+1" so one for the arithmetic operation and one for the assignment.

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

    Which language is used for the examples?

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

    Unable to understand from 7:29.
    Can someone please help !

  • @mohaarulez
    @mohaarulez 10 ปีที่แล้ว

    at 6:10 you give the assignment of sum 1 unit as a cost, but in the loop you ignore the assignment of the i value. Why is that? because the computer must assign a value, which takes time for the machine, shouldnt it be considerd as a cost?

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

    great effort sir sharing your knowledge dont stop sir

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

    love ur videos man, gr8 knowledge and english!

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

    Very nice explaination.... thanks 😃

  • @dotsandprintsdesigns4731
    @dotsandprintsdesigns4731 8 ปีที่แล้ว

    Thank you so much! Helped me with my exam :-)

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

    awesome explanation sir.Thanks

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

    at 7:58 it should be c' = c1 + c4 (because c2 is variable)

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

      what do you mean by c2 is variable,the eqn should be c1*1 + c2*(n+1) + c3*n + c4 reduces to (c2+c3)*n + c1 + c2 + c4 when equated to c*n + c' gives c=c2+c3 and c'=c1+c2+c4

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

      @@prasanna5836 nice explanation prasanna.

  •  6 ปีที่แล้ว

    Very nicely Explained ..

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

    Pointers to myself:
    Time Complexity - studying relationship b/w time and input size
    Looking at how time increases as input size increases or 'rate of growth of time' as input size grows

  • @AkashSharma-qv4lg
    @AkashSharma-qv4lg 8 ปีที่แล้ว +2

    at the point of 6:22 you told the cost for increment and comparison is there but it should be the cost of assignment of i=0 and comparison. Please explain sir

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

      It has been 3 years since you asked this question, and now you might have the answer. But for those with the same doubt...
      You don't have to initialize the loop variable i for each iteration of the loop. You just provide an initial value once (i=0) , and then check if the value of i still satisfies the condition after incrementing or decrementing i.
      Hence, i=0 assignment will take 1 unit time, while the comparison (condition checking) and increment/decrement steps will consume n+1 unit time each.
      I hope this helped.

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

    AWESOME regards from colombia

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

    great tutorial!

  • @seal3081
    @seal3081 8 ปีที่แล้ว

    I don't get 5:52.?
    The loop only goes from 0 to (n-1)
    Therefore shouldn't that "For Line" only be hit (n-1 - 0 + 1) = n times
    Eg) if n = 5 then loop goes from 0,1,2,3,4 because 4 = n-1
    0,1,2,3,4 is 5 times which is n not (n-1) as noted at 5:52

    • @ravikumarsingh3719
      @ravikumarsingh3719 8 ปีที่แล้ว

      For will evaluate n times and +1 for false condition so total cost comes to n+1

  • @MrEdinaldolaroque
    @MrEdinaldolaroque 8 ปีที่แล้ว

    Thank you for sharing! Valuable information.

  • @adamzerner5208
    @adamzerner5208 9 ปีที่แล้ว

    1:48 - why are we only interested the running time as a function of input size?

    • @hyax5586
      @hyax5586 9 ปีที่แล้ว

      +Adam Zerner Because the computers are continuously being made more powerfull and faster, so assuming that difficult and more complex programs are used by businesses, the army, universities, the government and so on... and they have good computers. So the only difference will be in the input size. :)
      But indeed if you have like a very old computer from like 20 years ago, it will make a big difference :P

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

    I am now 30 years on large scale enterprise projects. I never had to use such stuff.
    Where have you used in real projects and WHY ?

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

      you will use it when you will develop something from scratch. if you are working on maintenance or already developed projects, there is a good chance that you will never be able to make these decision because some-one else has made it already for that project.

  • @sharthakghosh970
    @sharthakghosh970 10 ปีที่แล้ว

    Awesome Explanation, thanks a lot

  • @Dylan-ig9pg
    @Dylan-ig9pg 9 ปีที่แล้ว +6

    for the for i=0 to n-1, why wouldn't the cost=3? 1 for i =0, 1 for comparison, and 1 for increment?

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

      +Michael Yelton the assignation of i= 0 only occurs one time as opposed to the other 2 expressions, so is not in function of "n" and becomes irrelevant to the algorithm complexity, the total cost would get to be 4n + 5 instead of 4n+4, anyway, expressing that on the big-O notation remains to be O(n), thats why that cost is usually ignored.
      The initialization cost of a loop should only be considered if is in function of n.

    • @AkshayKumar-dz5ts
      @AkshayKumar-dz5ts 7 ปีที่แล้ว +3

      cos that assignment occurs only once and thats the first time the for loop is considered so you can simply add 1 to the whole equation later but that wouldn't make a difference as we're trying to find how the time taken grows as we move on to higher values of 'n' and not trying to find the exact time taken for a particular value of 'n'

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

      @@ChamoyDonnie So basically, what we get is somewhat an approx value of time(because the cost 1 of i=0 is very small compared to the overall sum of the time(or cost)).

  • @gnanasuriyananbalagan4826
    @gnanasuriyananbalagan4826 11 ปีที่แล้ว

    Nice tutorial. Thanks for sharing.

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

    At 7:58th sec please check the equation, i think its not matching (the
    ''C"s equation )...and my 1st question: from interview bit, why did they give directly to algorithms(and suggested to Time complexity as it is in Level 1)... 2nd:Is it basic class of algorithm...3. Is algorithm needed to all?...and dont mind to bother you, please use some advanced teaching board/ can use typing or some other tools, which gives interest to learn and listen.

  • @akashsingh20031996
    @akashsingh20031996 8 ปีที่แล้ว

    BEST VIDEO EVER SEEN

  • @archiliusfowl3701
    @archiliusfowl3701 11 ปีที่แล้ว

    Well Done. Thank you very much and may God bless you.

  • @mycodeschool
    @mycodeschool  11 ปีที่แล้ว

    So, it will be executed n times for i= 0 to n-1.

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

    In your videos on Recursion and Sorting algorithms, you didn't consider 1 unit of time for return. You didn't count it in. But in this video, you did. Can you please explain?

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

      Because in Big O notation only the term with the highest index is taken while the others are ignored.

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

    Would it be practical to just test the time it takes for an algorithm to complete for a certain number of inputs and then graph it to see if it's linear or not? I mean, if we know the worst case scenario for the algorithm then we should be able to quickly run it a few times and gather some points and then plot it for a good estimate of the time complexity, right?

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

    at 7:42 from where c=c2+c3 came?

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

    Good explanation ,but had difficulty in understanding the part after the graph explanation.

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

    Why would we care about low level information such as 32 vs 64 bit, sequential or concurrent execution, or single vs multi processor? I feel like that stuff may speed up performance, but fundamentally shouldn't affect the time complexity of an algorithm.

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

      well the video basically clarifies this early on

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

    you said in above video that 1 times loop will run for false condition so there should be 'n' iterations whether than 'n+1'. may be i am wrong but kindly plz explain this

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

    baay'ee namatti tola jabaadhu leencoo ilma oromoo maal sagaleen kee akkas bareedu.

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

    Well explained! Thanks a lot!

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

    awsome explaination bro

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

    I explained it so well

  • @alekssandroassisbarbosa9570
    @alekssandroassisbarbosa9570 9 ปีที่แล้ว

    is it missing A[i]? or it shouldn't be 5n+4? can you please help me

  • @abdallahmahran
    @abdallahmahran 8 ปีที่แล้ว

    believe me u r a life saver

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

    I want to know how runtime of the program depends whether the processor is 32 bit or 64 bit?

  • @Mama-tm4yb
    @Mama-tm4yb 9 ปีที่แล้ว

    hey, why did you assume O(1) from the first example which led to a constant time of 2. why didn't you write '2'.. like this O(2) ?

    • @ChamoyDonnie
      @ChamoyDonnie 9 ปีที่แล้ว

      +Muntaha Tariq Thats the "big-O way" to express constant time, it could be 99 or even 999999 but is still expressed as 'O(1)' (constant), I recommend you to search a book named "Introduction to Algorithms - Cormen" on the first 2 chapters this is well defined.

    • @Mama-tm4yb
      @Mama-tm4yb 9 ปีที่แล้ว

      +Chamoy Donnie thankyou for guiding :)

    • @ChamoyDonnie
      @ChamoyDonnie 9 ปีที่แล้ว

      +Muntaha Tariq no problem :)

    • @ChamoyDonnie
      @ChamoyDonnie 9 ปีที่แล้ว

      +Muntaha Tariq no problem :)

  • @751_harshanand5
    @751_harshanand5 4 ปีที่แล้ว

    does including header files increases compilation time

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

    SPECTACULAR!!!!!!!!!!!!!!!! THANK YOU, AT LAST I TOTALLY UNDERSTAND WHATS GOING ON LOOL

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

    YOU ARE THE BEST!

  • @RupinderKaur-hu2yq
    @RupinderKaur-hu2yq 7 ปีที่แล้ว

    sir can u post one video totally based on all types of sorting real time examples

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

    It's hard to find an example with multiple conditional statements. I'd like to see how they tie that into the math section

  • @abkmf
    @abkmf 11 ปีที่แล้ว

    It said:
    0 to n-1
    Now, add 1 to both sides and it becomes:
    1 to n.
    I hope my explanation is helpful :).

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

    Very good video, thank you

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

    please explain Cn + C'; where, C = C(1) + C(2) + C(3 and C' = C(1) + C(2) + C(4); How does C and C' represent their respective constants?

    • @Billy-wo3qo
      @Billy-wo3qo 6 ปีที่แล้ว

      bump

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

      ​@@Billy-wo3qo I tried explaining it in another comment. Try checking that out.

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

    Thank you for your video !

  • @jona5820
    @jona5820 10 ปีที่แล้ว

    What to do with two for loops?
    for m=1:I
    for i=1:m
    also what about a while loop. How can I know how much that "cost"?

    • @jona5820
      @jona5820 9 ปีที่แล้ว

      ***** Thanks. Unfortunately it's a bit to late, my exam was almost four month ago. It went well. Even though I couldn't answer the question with computing time/"cost", my code where pretty good and compacted.

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

    Thanks a lot Archilius :)

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

    Thanks

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

    Could anyone tell me why hasn't he considered time take to specify I variable in the loop.. i =0 then i=1 and so on..

  • @Jack-mi9ok
    @Jack-mi9ok 10 ปีที่แล้ว

    Thank you, very easy to understand with the subtitles

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

    Is this i

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

    By any chance, you are from GEU?