Join the ropes question

what is the overall time complexity??

@shampblocks hey app sabse pehle n elements pq me dal rhe ho uski complexity n logn then app 2 elements bar nikal ke wapis ke daloge so approx apki klogk me hogi where k random hoga koi bhi ,so hm approximation lga ke hm ye bol skte hai ki nlogn hogi kyunki hm worst case me dekhte hai.Hope you get it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.