Browse Source

Adding comment headers and putting images in their own dir.

master
Charles Reid 8 years ago
parent
commit
65f628c059
  1. 0
      arrays/img/listsize-longer.png
  2. 0
      arrays/img/listsize-pop.png
  3. 0
      arrays/img/listsize.png
  4. 12
      arrays/listsize-exhausted.py
  5. 12
      arrays/listsize-pop.py
  6. 12
      arrays/listsize.py
  7. 14
      arrays/plot-listsize-pop.py
  8. 13
      arrays/plot-listsize.py

0
arrays/listsize-longer.png → arrays/img/listsize-longer.png

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
arrays/listsize-pop.png → arrays/img/listsize-pop.png

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

0
arrays/listsize.png → arrays/img/listsize.png

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

12
arrays/listsize-exhausted.py

@ -1,5 +1,17 @@ @@ -1,5 +1,17 @@
import sys
"""
Goodrich et al
Data Structures in Python
Chapter 5: Array-Based Sequences
Question R-2
Determine sequence of array sizes where
the array size is exhausted and must be
expanded.
"""
n = 10000
data = []

12
arrays/listsize-pop.py

@ -1,5 +1,17 @@ @@ -1,5 +1,17 @@
import sys
"""
Goodrich et al
Data Structures in Python
Chapter 5: Array-Based Sequences
Question R-3
Modify code fragment to demonstrate that
the list class reizes its underlying array
when you pop elements from the list
"""
data = []
sequence = [1000,-800,200,-200,1000]

12
arrays/listsize.py

@ -1,4 +1,16 @@ @@ -1,4 +1,16 @@
import sys
"""
Goodrich et al
Data Structures in Python
Chapter 5: Array-Based Sequences
Question R-1
Run code fragment 5.1 and compare results
to those in textbook.
"""
data = []
n = 50
for k in range(n+1):

14
arrays/plot-listsize-pop.py

@ -2,6 +2,20 @@ import sys @@ -2,6 +2,20 @@ import sys
from matplotlib.pyplot import *
import seaborn as sns
"""
Goodrich et al
Data Structures in Python
Chapter 5: Array-Based Sequences
Question R-3
Modify code fragment to demonstrate that
the list class reizes its underlying array
when you pop elements from the list
PLOTS OR IT DIDNT HAPPEN
"""
data = []
sequence = [1000,-800,200,-200,1000]

13
arrays/plot-listsize.py

@ -2,6 +2,19 @@ import sys @@ -2,6 +2,19 @@ import sys
from matplotlib.pyplot import *
import seaborn as sns
"""
Goodrich et al
Data Structures in Python
Chapter 5: Array-Based Sequences
Question R-1
Run code fragment 5.1 and compare results
to those in textbook.
PLOTS OR IT DIDNT HAPPEN
"""
data = []
n = 10000

Loading…
Cancel
Save