Top 50 DSA Interview Questions And Answers
1. What is an Array? An array is a collection of elements stored at contiguous memory locations. All elements in an array must be of the same data type. Arrays allow random access to elements, meaning you can access any element using its index. Example: int[] arr = {1, 2, 3, 4, 5};System.out.println(arr[2]); // Output: … Read more