You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Command allows to set a value at a specific index in an array.
Time Complexity: O(N) where N is the length of the array . Setting either the first or the last element of the array is O(1).
2. Push
A.PUSH key element [element ...]
Description: Insert all the specified values at the end of the array stored at key. If key doesn't exist an error is returned.
Time Complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
3. Get at
A.GET_AT key index
Description: Returns the element at index index in the array stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. In case the value is not a array, an error is returned. When
Time Complexity: O(N) where N is the length of the array. Setting either the first or the last element of the array is O(1).
4. A.POP:
A.POP key
Description: Removes and returns the last elements of the array stored at key If key doesn't not exists an error is returned.
Time Complexity: O(1)
5. A.INDEX_OF:
A.INDEX_OF key value
Description: Returns the first index at which a given element can be found in the array, or -1 if it is not present. If key doesn't not exists an error is returned.
Time Complexity: O(N) where N is the number of elements.
6. A.DELETE:
A.DELETE key index
Description: Removes element at index from key if index < 0 then it should start from the end, for example -1 should delete the last one. If key doesn't not exists an error is returned
Time Complexity: O(N) where N is the number of elements.
The text was updated successfully, but these errors were encountered:
1. Insert
2. Push
3. Get at
4. A.POP:
5. A.INDEX_OF:
6. A.DELETE:
The text was updated successfully, but these errors were encountered: