Array Flashcards
1
Q
Time complexity
A
Access by index - o(1)
Search - (n)
Add in the end - o(1)
Add at any location - O(n)
2
Q
Techniques
A
- linear search
- double pointer search - front,back
- divide and search
3
Q
Array Sort in ascending order
A
Arrays.sort( T[])
Arrays.sort(T[], Collections.reverseOrder())