Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shrinking
#1
I originally had a check in my shrink method that would set the capacity to 1 if the array was going empty, which would be consistent with the operation of the extract method which resets the size to 0 and the capacity to 1. Just to confirm, the expected capacity when shrinking an array to empty is 2?
Reply
#2
Yes....
Reply
#3
Depends how you get there.

Insert, Insert, Insert, Insert, Delete, Delete, Delete, Delete -> [][2]

Insert, Insert, Insert, Insert, Delete, Delete, Delete, Delete, Insert, Delete -> [][1]
Reply
#4
Thank you. I understand now.
I have no idea what I'm doing, but I know I'm doing it really, really well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)