0% found this document useful (0 votes)
4 views1 page

Array Operations and Techniques Guide

The document outlines various operations and concepts related to arrays, including printing elements, summing elements, reversing arrays, and rotating arrays. It also discusses subarrays, prefix sums, and techniques like sliding window and contribution technique. Additionally, it covers 2D arrays, diagonal elements, and time complexity considerations in relation to space complexity.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Array Operations and Techniques Guide

The document outlines various operations and concepts related to arrays, including printing elements, summing elements, reversing arrays, and rotating arrays. It also discusses subarrays, prefix sums, and techniques like sliding window and contribution technique. Additionally, it covers 2D arrays, diagonal elements, and time complexity considerations in relation to space complexity.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

print array elements

sum of array
sum of elements in range
reverse array
revere array in range
rotate k times array
Dynamic array
prefix sum
carryforward
subarray->continuous part -> start at one point and end at any point from left to
right, may have one element also
print all the subarrays
print sum of each sub array
print sum of all the sub arrays
contribution technique
sliding window
2d arrays:an arraya of array N(rows) = [Link], M(columns) = A[0].length
for square matrix: diagonal indices: (0,0),(1,1),(2,2).. (n-1)(n-1) antidiagonal:
(0,n-1),(1,n-1),(2,n-1).....(n-1)(n-1)
print all the diagonal elements from right to left (anti diagonal)
print no of diagonals from anti diagonal: N+M-1
print transapose of matrix
print roatate of matrix

python - list
java - arraylist & operations

prefix sum

array of array
first
time complexity:
prefix sum: create array of size n

time complexity is more prior than space complexity

You might also like