You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/algorithms/statistics/weighted-random/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ const weightedItems = [
59
59
// And now just pick the random item from weightedItems array.
60
60
```
61
61
62
-
However, as you may see, this approach may require a lot of memory, in case if the objects are heavy, and in case if we have a lot of them to repeat in `weightedItems` list.
62
+
However, as you may see, this approach may require a lot of memory, in case if we have a lot of items to repeat in `weightedItems` list. Think of it as if you would need to repeat a string like `"some-random-string"` (`18` bytes) a ten million times. You will need to allocate around `180Mb` of additional memory space just for this array.
0 commit comments