šŸ“˜ Intro to DS Main Site ↗

šŸ“Š Array Operations in C Size: 7 / 10

Step through contiguous memory shifts, pointer math, and line-by-line C execution.

⚔ Select Operation / Algorithm:
šŸ’” Select an operation and choose Auto Play or Step Manually.
Step 0 / 0
1.6s / step
šŸ’» C Source Execution View
GCC / C99
šŸ” Variables Watch
Real-time Stack Values
No active variables

⚔ Time Complexity Breakdown

Operation Best Case Worst Case Description
Access by Index O(1) O(1) Direct memory address calculation
Search (Linear) O(1) O(n) Checks elements one by one
Search (Binary) O(1) O(log n) Halves array range on sorted data
Insertion O(1) O(n) End insert vs index insert (shifts elements)
Deletion O(1) O(n) End delete vs index delete (shifts elements)

🧠 C Pointer Arithmetic Formula

In C language, an array variable arr is a pointer constant to &arr[0].

arr[i] ≔ *(arr + i)
Address of index i = Base Address + (i * sizeof(datatype))

šŸ“ Self-Assessment Knowledge Check