Rollback Idea on Union Find | Small to Large merging | Advanced Idea | Part 3

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024

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

  • @vivekgupta3484
    @vivekgupta3484  2 ปีที่แล้ว +4

    Do like and Subscribe to support creating more such educational content!

  • @LeoLeo-nx5gi
    @LeoLeo-nx5gi ปีที่แล้ว +3

    Man how did I miss this, Thanks a ton Vivek!!

  • @anubhavgupta5184
    @anubhavgupta5184 5 หลายเดือนก่อน

    Thanks vivek for this appreciate.
    Could you please share the implementation of this if possible. ?

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

    Hi Vivek, You can add related problems under every video which will help in implementing the learned concepts. Otherwise Great Content as usual 🔥

  • @srishtikdutta8946
    @srishtikdutta8946 2 ปีที่แล้ว +3

    Some problems to practice plz.

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

    👍👍👍👍

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

    Could anyone suggest a good problem?
    I checked out CP algos
    Looked at the implementation using stack but i have no idea when and how to use it in problems

  • @pratyushprateek2934
    @pratyushprateek2934 4 หลายเดือนก่อน

    Won’t find operation without path compression takes O(n) in worst case? If it becomes a skewed tree?

    • @vivekgupta3484
      @vivekgupta3484  4 หลายเดือนก่อน

      Rank compression ensures height as logN.

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

    is there no way to use path compression along with rollback efficiently?

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

      whatever you do needs to be reverted... You might to revert O(logn) things... so its best to only do rank compression.

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

      @@vivekgupta3484 already find and unite working in O(logn) in rank compression so isn't O(1) rollback quite insignificant improvement. Isn't adding path compression to this sensible?

    • @adityaraghav8693
      @adityaraghav8693 5 หลายเดือนก่อน

      ​@@srijaysinghgusain7245 rollback is not improvement, its a functionality that allows you to query on updated version of DSU without creating DSU from scratch( which is O(N) )