summaryrefslogtreecommitdiff
path: root/01-21.md
diff options
context:
space:
mode:
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)