Array - linear data structure
- index(
pointer
) manipulation - check
bound
inloop
skip
element to avoidduplicate
- element
remove
,replace
,partation
- use
HashMap
to cache data two pointers
used on sorted arraymath logic
usually related withswap
andreverse
2D
index manipulation- use
boolean array
to cacheused
orvisited
state - consider
each element
and then combine the result digits
manipulation, use of acarry
stateint[] arr = new int[n+1]
In place
manipulation- use one pointer to move
- use two pointers to swap
- use value to store state, 0 or 1, or use equations to generate multiply states
- index usually involved with ‘
+1
’ or ‘-1
’ - usage of
sum
- two pass,
forward
andbackword
- shift k position –
triple reversion
– (n-k)(1),k(2), n(3) slidig window
andMap
orSet
or TreeMap or TreeSet(ceiling(x), floor(x))- update
min1
andmin2
pointer