From d59d435ec6653d456c05d1a535f016226a87c06d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Feb 2025 22:41:03 -0700 Subject: [PATCH] [decycler] Comments --- src/hb-decycler.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-decycler.hh b/src/hb-decycler.hh index e944f350f..49dbe5be0 100644 --- a/src/hb-decycler.hh +++ b/src/hb-decycler.hh @@ -38,11 +38,11 @@ * For Floyd's tortoise and hare algorithm, see: * https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare * - * Like Floyd's algorithm, hb_decycler_t is O(n) in the number of nodes - * in the graph. Unlike Floyd's algorithm, hb_decycler_t is designed - * to be used in a DFS traversal, where the graph is not a simple - * linked list, but a tree with cycles. Like Floyd's algorithm, it is - * constant-memory (just two pointers). + * hb_decycler_t is O(n) in the number of nodes in the DFS traversal + * if there are no cycles. Unlike Floyd's algorithm, hb_decycler_t + * can be used in a DFS traversal, where the graph is not a simple + * linked list, but a tree with possible cycles. Like Floyd's algorithm, + * it is constant-memory (~three pointers). * * The decycler works by creating an implicit linked-list on the stack, * of the path from the root to the current node, and apply Floyd's