Recursion - Activation Records - Stack

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

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

  • @roronoazoro-518
    @roronoazoro-518 4 года назад +3

    I clearly understood the whole concept..Thanks a lot sir for your efforts!

  • @khalila.3347
    @khalila.3347 7 лет назад +6

    This function is return type as this function is returning value of x*y. But you write
    void fact(int n) {
    //code here
    }
    i think it should be like this
    int fact(int n){
    //code here
    }

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

    👌

  • @sarathk995
    @sarathk995 7 лет назад +2

    awesome explanation..thank u sir

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

    kudos to you sir!

  • @abhishekkumar-os5zk
    @abhishekkumar-os5zk 6 лет назад +5

    fact function return type is wrong . bro correct it .

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

    thank you sir, very helpful video

  • @sureshrakes2780
    @sureshrakes2780 7 лет назад +1

    Bahuth acha

  • @deepakborah8335
    @deepakborah8335 7 лет назад +1

    Recursion is encountered.

  • @roronoazoro-518
    @roronoazoro-518 4 года назад

    8:47

  • @manuraj8889
    @manuraj8889 5 лет назад

    Thanks a lot sir😍.

  • @shereenpv1353
    @shereenpv1353 7 лет назад

    sir ..thank you for your effort...would you please upload a video for how to remove recursion using stack?

    • @madhivarman508
      @madhivarman508 7 лет назад

      recursion function is automatically popped out from the stack when the iteration of the function is over.. In this video he had explained this concept .. when the if condition satisfied the compiler starts returning x*y and updates y value respectively... and when all x*y finished the value will stored at x . At line 3, compiler removes all recursions from the stack ... :)

  • @aryamukherjee2443
    @aryamukherjee2443 7 лет назад

    Sir please can you explain one simple thing? Sir, you said in scope and lifetime of variables the fact function lifetime has expired so its return value cant be accepted... so how r we accepting here? i am getting confused... Sir please clear the matter! please Sir

    • @rohitsancheti96
      @rohitsancheti96 7 лет назад

      if you are returning reference than it would be a problem..but if you use call by value it wouldn't be a problem

  • @mayurnagdev5545
    @mayurnagdev5545 6 лет назад +1

    the data type of fact() must be int.

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

    college professors are worst , thanks sir

  • @shreyastorgalmath5357
    @shreyastorgalmath5357 6 лет назад

    u cant return two element

    • @misterkid
      @misterkid 6 лет назад

      it's returning one element (x*y)
      but it's void so it can't return

    • @harshmk1052
      @harshmk1052 4 года назад +2

      @@misterkid the return type is int .
      He had cleared that in the paid course .