The Beastie Forums
Extract CDA - Printable Version

+- The Beastie Forums (http://beastie.cs.ua.edu/mybb)
+-- Forum: Analysis of Algorithms (http://beastie.cs.ua.edu/mybb/forumdisplay.php?fid=3)
+--- Forum: Project 0 (http://beastie.cs.ua.edu/mybb/forumdisplay.php?fid=4)
+--- Thread: Extract CDA (/showthread.php?tid=175)



Extract CDA - Logand064 - 09-11-2017

When extracting CDA should we be using the getCDA method to ensure the array is in the appropriate order? If so this should take linear time correct?


RE: Extract CDA - ianbway - 09-11-2017

(09-11-2017, 04:47 AM)Logand064 Wrote: When extracting CDA should we be using the getCDA method to ensure the array is in the appropriate order? If so this should take linear time correct?

My extract method calls shrink private method, which has an incrementing for loop in it that calls getCDA on every pass (which ensures appropriate order). The loop makes it linear.


RE: Extract CDA - lusth - 09-13-2017

Linear time in the worst case is expected for this operation.