0% found this document useful (0 votes)
3 views3 pages

Assignment on Data Structure

The document outlines a series of programming assignments focused on array manipulation and operations. It includes tasks such as summing elements, finding minimum and maximum values, counting occurrences, merging arrays, rotating arrays, identifying duplicates, solving the two-sum problem, moving zeroes, extracting elements in spiral order from a matrix, and rotating a 2D image. Each task requires the implementation of a specific function to achieve the desired outcome.

Uploaded by

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

Assignment on Data Structure

The document outlines a series of programming assignments focused on array manipulation and operations. It includes tasks such as summing elements, finding minimum and maximum values, counting occurrences, merging arrays, rotating arrays, identifying duplicates, solving the two-sum problem, moving zeroes, extracting elements in spiral order from a matrix, and rotating a 2D image. Each task requires the implementation of a specific function to achieve the desired outcome.

Uploaded by

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

Assignment:

1. Sum of Elements: Write a function that takes an array of numbers and returns the sum of all the
elements.

2. Find Minimum and Maximum: Create a function that returns both the minimum and maximum
values from an array of integers.

3. Count Occurrences: Implement a function that counts how many times a specified element
appears in an array.

4. Merge Two Arrays: Write a function that merges two sorted arrays into a single sorted array.

5. Array Rotation: Develop a function that rotates an array to the left by a given
number of positions.

6. Find Duplicates: Create a function that returns an array of duplicate values from an input array,
without using extra space.

7. Two Sum Problem: Write a function that finds two numbers in an array that sum up to a specific
target value and returns their indices.

8. Move Zeroes: Implement a function that moves all zeroes in an array to the end while maintaining
the order of non-zero elements.

9. Spiral Matrix: Write a function that takes a 2D array (matrix) and returns the elements in a spiral
order.

10. Rotate Image: Given an `n x n` 2D matrix representing an image, rotate the image by
90 degrees clockwise.

You might also like