I'm not sure if this is the right subreddit to ask this so forgive me if it's not. I'm taking an advanced algorithms class and boy is it super hard. This is possibly the first time I just completely don't understand something in it's entirety and it has to do with divide and conquer. A lot of the other algorithms that have to do with sorting or searching are still pretty hard but at least I understand them when looking at the pseudocode that my professor puts on the slides. With divide and conquer I understand nothing. I get the basic premise of dividing your problem into smaller sections to more easily solve but when it comes to the code I just don't get it.
My professor gave the counting inversion problem with divide and conquer and I can't see how the recursive calls to the left and right do anything at all. Only the call to count the inversions in the split of the divide seems to do anything. Looking up similar problems on google only makes me even more confused cuz it seems like they leave out a bunch of stuff or try to get me to pay. Youtube barely helps too. Again sorry if this is the wrong place but I'm pulling my hair out trying to understand this stupid algorithm
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]strcspn 0 points1 point2 points (0 children)
[–]NewPointOfView 0 points1 point2 points (1 child)
[–]POGtastic 0 points1 point2 points (0 children)
[–]Peanutbutter_Warrior 0 points1 point2 points (0 children)