Performance analysis on startDate and endDate on OCKSchedule
#748
Unanswered
vanvoorden
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I'm a little curious about the runtime and space complexity performance of
startDate()andendDate()onOCKSchedule.1Why must we perform
O(n log n)work to return the minimumDate? And why must we createO(n)additional storage?Could
startDate()andendDate()both be refactored to return inO(n)time andO(1)space?What about something like:
And then something similar for
endDate()?Footnotes
https://github.com/carekit-apple/CareKit/blob/4.1.0/CareKitStore/CareKitStore/Structs/OCKSchedule.swift#L64-L82 ↩
All reactions