Dsa L5
Dsa L5
score0 score[0]
score1 score[1]
… …
score9 score[9]
Subscripting Indexing
start 1 2
i=0 i=0
i++ i++
i < 10 Process i < 10
read score[i] write score[i]
1 2 stop
DYNAMIC ARRAYS
• What are they?
capacity >>= 1;
• Let us understand the operations needed to // update the global array pointer
implement a dynamic array: insert, remove etc. }
arr = newArr;
(shrink)
{An entries array of length 10 with 6 {Copying the new entry into the position.
GameEntry objects (maxExntries: 10, Scenario after addition}
numEntries: 6)}
(Lab3: GameEntry.cpp)
LAB3 TASKS: GAME ENTRY
(How many number of entries are there for each player? Option 4)