summaryrefslogtreecommitdiff
path: root/01-21.md
diff options
context:
space:
mode:
authorlshprung <lshprung@yahoo.com>2021-01-26 10:00:52 -0800
committerlshprung <lshprung@yahoo.com>2021-01-26 10:00:52 -0800
commitce4ab12872270cda61a5c72e8420ddb730cd4c29 (patch)
treea8ab6e2d585eaa35b80eced6190cc6a53ef4990d /01-21.md
parenta8a1645a8d6ca451d620b942dd5744705e85af0b (diff)
Post-class 01/26
Diffstat (limited to '01-21.md')
-rw-r--r--01-21.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/01-21.md b/01-21.md
index 7221a67..2f1c4e2 100644
--- a/01-21.md
+++ b/01-21.md
@@ -320,6 +320,7 @@ for(i = 0; i < used; ++i){
- In the worst case, the loop does execute a full `n` iterations, therefore the correct time analysis is no better than O(n)
- Several of the other bag functions do not contain any loops at all, and do not call any functions with loops
- Example, when an item is added to a bag, the new item is always placed at the end of the array
+- This class would be good to use if you need to do a lot of insertion, and not as many removals
---
@@ -332,3 +333,7 @@ for(i = 0; i < used; ++i){
- The array
- A variable to keep track of how much of the array is being used
- At the top of the implementation file: When you design a class, always make an explicit statement of the rules (**invariant of the class**) that dictate how the member variables are used
+
+---
+
+[01/26 ->](01-26.md)