Swap two numbers without using third (temporary) variable

Поделиться
HTML-код
  • Опубликовано: 9 окт 2024
  • Swap two numbers without using third (temporary) variable .

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

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

    Good video! You may be aware also that it is possible to implement a double-linked link using just one link per node (instead of the usual two, previous and next), which could save a significant amount of memory if the rest of the node is small. The link in each node is the XOR of the addresses of the previous and next entries (if a node has no previous or no next entry, then use zero). You can iterate the list in either direction.
    But this technique is of limited practical value because you can't unlink a node if given a pointer to only that node -- you must have pointers to the nodes on either side. (Likewise, to insert a node between two nodes, you need pointers to both nodes.) This is probably why this technique is not used much in practice (that I am aware of).

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

    Bro, your teaching skill is very good. Good luck for your next videos.

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

    Divide an array into 4 subarrays such that sum = sum1 - sum2 + sum3 - sum4 is maximum. (sum1 denotes sum of elements of subarray)
    Conditions : sum1 occurs before sum2, which occurs before sum3 subarray and so on. Also, sum1 sum2 etc can be zero (empty subarray).

  • @devacool11
    @devacool11 5 лет назад +1

    Could you please make a video on 'Golden Section Search' algorithm, its applications in computer science/programming, comparison with binary search and relevant details?

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

    Good explanation... Apply fast and work fast...

  • @AnjaliSingh-dm7ue
    @AnjaliSingh-dm7ue 6 лет назад +2

    Your explanation is very nice but please explain how these swapping methods has come on which you did all the calculations because we can't remember everything

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

    hi Vivekanand, if possible could you please post a video related to "Add two numbers without using arithmetic operators"

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

    Can you please also explain few recursion problems with examples like finding the possible string encodings of a number.ex 123 gives ABC , LC , AW

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

      Shruti B Divide an array into 4 subarrays such that sum = sum1 - sum2 + sum3 - sum4 is maximum. (sum1 denotes sum of elements of subarray)
      Conditions : sum1 occurs before sum2, which occurs before sum3 subarray and so on. Also, sum1 sum2 etc can be zero (empty subarray).

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

    Hi Vivek, subscribed your channel today only and find it very useful. can you please post video on reverse stack using recursion.

  • @Codeshub2024
    @Codeshub2024 4 года назад

    In functions without arguments .explain the same program, please sir

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

    Why have you removed the Tree from the playlist?

  • @subbu4u
    @subbu4u 4 года назад

    Hi...if possible can you please make videos on concept of Hashing in C.
    Thanks

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

    Why you disabled discussion tab from main page of the canal

  • @ryan-bo2xi
    @ryan-bo2xi 5 лет назад

    Awesome explanation

  • @SurajAgarwaladad
    @SurajAgarwaladad 6 лет назад +2

    Make videos on bit masking

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

      Suraj Agarwal Divide an array into 4 subarrays such that sum = sum1 - sum2 + sum3 - sum4 is maximum. (sum1 denotes sum of elements of subarray)
      Conditions : sum1 occurs before sum2, which occurs before sum3 subarray and so on. Also, sum1 sum2 etc can be zero (empty subarray).

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

    Useful video. Thank you

  • @nemesisanims7401
    @nemesisanims7401 4 года назад

    which language you use?

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

    pls do the programs on string

  • @riturajs1985
    @riturajs1985 4 года назад

    nicely explained

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

    find xor of elements in a given range, please make video on this

  • @45_ritiksharma32
    @45_ritiksharma32 4 года назад

    Plz upload some more vidios

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

    Thats not xor symbol, as i know

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

      Naren Suri Divide an array into 4 subarrays such that sum = sum1 - sum2 + sum3 - sum4 is maximum. (sum1 denotes sum of elements of subarray)
      Conditions : sum1 occurs before sum2, which occurs before sum3 subarray and so on. Also, sum1 sum2 etc can be zero (empty subarray).

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

      That's XOR in C