algorithm - Understanding divide and conquer paradigm -
suppose have 1d array = [0...n-1]. define "hole" position in adjacent positions greater it. 1d means [i] < [i-1] < [i+1] (if 0 check i+1 , if n-1 check n-2). divide , conquer method solve in 1d case, or in case of square matrix? in square matrix, (0,0) hole if it's less (0,1) , (1,0) (so corners corners).
i feel understand divide , conquer, when comes applying problems stumped. asked 1d question in interview , failed solve it. interviewer told me 2d square case challenging extension practice (that hardly able solve in full). i'm happy psuedocode, want idea of what's going on.
Comments
Post a Comment