From 538c4011db6360f6a702fce05b9da1627862b23b Mon Sep 17 00:00:00 2001 From: Greeshmanth Penugonda <79304704+Greeshmanth1@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:22:18 +0530 Subject: [PATCH 1/2] Update sortedlist.py Added time complexity for the '__len__()' method. --- src/sortedcontainers/sortedlist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sortedcontainers/sortedlist.py b/src/sortedcontainers/sortedlist.py index aecf787..54e04de 100644 --- a/src/sortedcontainers/sortedlist.py +++ b/src/sortedcontainers/sortedlist.py @@ -1076,7 +1076,9 @@ def __len__(self): """Return the size of the sorted list. ``sl.__len__()`` <==> ``len(sl)`` - + + Runtime complexity: `O(1)` + :return: size of sorted list """ From c230b41e1aa7b4fff36d62ed9d4cb7c82fe36109 Mon Sep 17 00:00:00 2001 From: Greeshmanth Penugonda <79304704+Greeshmanth1@users.noreply.github.com> Date: Fri, 8 Mar 2024 23:08:07 +0530 Subject: [PATCH 2/2] Update sortedset.py Added runtime complexity for the __len__() method. --- src/sortedcontainers/sortedset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sortedcontainers/sortedset.py b/src/sortedcontainers/sortedset.py index f2416bf..2071d63 100644 --- a/src/sortedcontainers/sortedset.py +++ b/src/sortedcontainers/sortedset.py @@ -289,7 +289,9 @@ def __len__(self): """Return the size of the sorted set. ``ss.__len__()`` <==> ``len(ss)`` - + + Runtime complexity: `O(1)` + :return: size of sorted set """