operations that can be performed on an array.

By vivek kumar in 20 Jul 2024 | 08:53 pm
vivek kumar

vivek kumar

Student
Posts: 552
Member since: 20 Jul 2024

operations that can be performed on an array.

20 Jul 2024 | 08:53 pm
0 Likes
Prince

Prince

Student
Posts: 557
Member since: 20 Jul 2024

operations that can be performed on an array.



concise summary of operations on an array:


  1. Access:

    • Retrieve element by index.

    • Time Complexity: O(1)
  2. Insertion:

    • Add element at end or specific position.

    • Time Complexity: O(1) (end), O(n) (specific position)

  3. Deletion:

    • Remove element from end or specific position.

    • Time Complexity: O(1) (end), O(n) (specific position)

  4. Search:

    • Find element or index.

    • Time Complexity: O(n) (unsorted), O(log n) (sorted)

  5. Update:

    • Modify value at index.

    • Time Complexity: O(1)

  6. Traversal:

    • Iterate through all elements.

    • Time Complexity: O(n)

  7. Resize:

    • Change array size (dynamic arrays).

    • Time Complexity: O(n)

  8. Sorting:

    • Arrange elements in order.

    • Time Complexity: O(n log n)

  9. Reversing:

    • Reverse the order of elements.

    • Time Complexity: O(n)

  10. Copying:

    • Duplicate the array.

    • Time Complexity: O(n)
21 Jul 2024 | 01:33 am
0 Likes

Report

Please describe about the report short and clearly.