From 223c8d226d5c1d44e4c7fe645073768b712ed88f Mon Sep 17 00:00:00 2001 From: fr33m0nk Date: Thu, 4 Apr 2024 15:15:10 +0530 Subject: [PATCH] update documentations --- src/data_structures/queue/list.clj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data_structures/queue/list.clj b/src/data_structures/queue/list.clj index e4f7d95..68346bf 100644 --- a/src/data_structures/queue/list.clj +++ b/src/data_structures/queue/list.clj @@ -15,6 +15,8 @@ (drop-last 1 queue))) (defn peek-queue + "this implementation is more performant than using `last` or `reverse` + they both traverse the entire collection whereas count is stored on the PersistenceList object" [queue] (when-not (empty? queue) (nth queue (dec (count queue)))))