From ce4ab12872270cda61a5c72e8420ddb730cd4c29 Mon Sep 17 00:00:00 2001 From: lshprung Date: Tue, 26 Jan 2021 10:00:52 -0800 Subject: Post-class 01/26 --- 01-21.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to '01-21.md') 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) -- cgit