From 209e14c458175eb372e239f90d6182ee6c50149d Mon Sep 17 00:00:00 2001 From: Danny McGee Date: Wed, 24 Jan 2024 16:50:05 -0500 Subject: [PATCH] Fix doc comment --- studio/src/algo.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/studio/src/algo.rs b/studio/src/algo.rs index 484c55e..2a9dc7e 100644 --- a/studio/src/algo.rs +++ b/studio/src/algo.rs @@ -18,8 +18,12 @@ pub(crate) fn find_parent(target: Entity, q_parents: &Query>) -> /// Find the nearest common ancestor entity of a set of `entities`. Returns /// `None` if the provided `entities` do not have a common ancestor. /// -/// - Time: O(D) where D = the depth of the deepest member of `entities` -/// - Space: O(N) where N = the length of `entities` +/// - Time: O(DN) +/// - Space: O(N) +/// +/// where +/// - D = depth of the most deeply-nested member of `entites` +/// - N = the number of `entities` provided pub(crate) fn nearest_common_ancestor( entities: &[Entity], q_parents: &Query>,