You are on page 1of 1

DSA Lab-01

 Implement the given task and submit before the end of lab.
 Submit your tasks at email: awaisamin0022@gmail.com
 Mentioned your Lab week, Name and Roll No in Subject line i-e Lab-01 Ali 001

Tasks:
1-D Array

1. Declare and initialize a 1-D array of strings with five elements.


2. Write a program to find the largest element in a given 1-D integer array.
3. Implement a function to reverse the elements of a 1-D array.
4. Write a program to count the occurrences of a specific element in a 1-D array.
5. Implement a program to merge two sorted 1-D arrays into a single sorted array.
6. Write a function to remove all duplicate elements from a 1-D array.
7. Create a program to find the second smallest element in a 1-D array of integers.

2-D Array

1. Declare and initialize a 2-D array of integers with dimensions 3x3.


2. Write a program to find the sum of all elements in a given 2-D array.
3. Implement a function to transpose a given 2-D array.
4. Write a function to extract and print the elements of a specific row in a 2-D array.
5. Implement a program to multiply two given 2-D arrays.
6. Write a function to find the maximum element in each row of a 2-D array and store the
results in a 1-D array.
7. Create a program to sort the rows of a 2-D array in ascending order based on the sum
of their elements.

You might also like