If we were designing a more accommodating data structure that grew as we inserted something, we might very well have to place the code that expanded the array into the timing loop. ![]() It works for our current purpose, since we are timing a single insertion into a fixed-size array - even though we are repeating the task many times. This allows us to insert an item without losing any data. To test inserting a new element into an array, we will make a symbolic gesture in the direction of creating space for the new element to be placed: Anticipating a single insertion, we will make the array one element larger than the original data set. ![]() Section 6 - Inserting and Sorting 1A.6.1 Inserting
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |