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

Arrays

The document lists various data structure and algorithm (DSA) questions focused on arrays. It includes tasks such as finding the largest and smallest elements, calculating the sum of elements, reversing an array, and identifying duplicates. Additional challenges involve checking if an array is sorted, finding intersections and unions of two arrays, and manipulating elements like moving zeros to the end.

Uploaded by

mittaldonesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Arrays

The document lists various data structure and algorithm (DSA) questions focused on arrays. It includes tasks such as finding the largest and smallest elements, calculating the sum of elements, reversing an array, and identifying duplicates. Additional challenges involve checking if an array is sorted, finding intersections and unions of two arrays, and manipulating elements like moving zeros to the end.

Uploaded by

mittaldonesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DSA QUESTIONS

Arrays

1. Find the Largest Element: Write a function to find the largest element in an
array.
2. Find the Smallest Element: Write a function to find the smallest element in
an array.
3. Sum of All Elements: Calculate the sum of all elements in an array.
4. Reverse an Array: Write a function to reverse the order of elements in an
array.
5. Find the Second Largest Element: Write a function to find the second
largest element in an array.
6. Find the Second Smallest Element: Write a function to find the second
smallest element in an array.
7. Check if Array is Sorted: Write a function to check if an array is sorted in
ascending order.
8. Remove Duplicates: Write a function to remove duplicate elements from an
array.
9. Find the Missing Number: Given an array of n-1 elements in the range of 1
to n, write a function to find the missing number.
10. Find the Duplicate Number: Given an array of n+1 elements in the range of
1 to n, write a function to find the duplicate number.
11. Find the Intersection of Two Arrays: Write a function to find the common
elements between two arrays.
12. Find the Union of Two Arrays: Write a function to find all unique elements
present in two arrays.
13. Move Zeros to End: Write a function to move all zeros in an array to the end
while maintaining the order of non-zero elements.
14. Find the Majority Element: Write a function to find the element that appears
more than half the time in an array.
15. Find the Element that Appears Once: Write a function to find the element
that appears only once in an array where every other element appears
twice.

You might also like