Skip to content

Maintain positions in an array taking into account items being removed and added

Notifications You must be signed in to change notification settings

sharan-space1/remember-array-indices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Remember Array Indices

Maintain positions in an array taking into account items being removed and added

For Example:

If I start with an array [ 1, 2, 3, 4, 5 ]
               with indices [ 0, 1, 2, 3, 4 ]

An operation that removes 2 from the array would cause:
Array   : [ 1, 3, 4, 5 ]
Indices: [ 0, 1, 2, 3 ]

And an operation that adds 2 back would make the array:
Array   : [ 1, 2, 3, 4, 5 ]
Indices: [ 0, 1, 2, 3, 4 ]

About

Maintain positions in an array taking into account items being removed and added

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published