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

Data Structures Lab Arrays Iterative Recursive

The document outlines a Data Structures Lab for B.Tech Computer Science students, focusing on arrays and both iterative and recursive methods. It includes five lab exercises that require students to perform tasks such as reading and displaying array elements, finding the largest and smallest elements, calculating sums using recursion, and comparing iterative and recursive linear search methods. Additionally, students are tasked with reversing an array using both approaches and displaying results after each operation.

Uploaded by

Apala Mandal
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)
4 views1 page

Data Structures Lab Arrays Iterative Recursive

The document outlines a Data Structures Lab for B.Tech Computer Science students, focusing on arrays and both iterative and recursive methods. It includes five lab exercises that require students to perform tasks such as reading and displaying array elements, finding the largest and smallest elements, calculating sums using recursion, and comparing iterative and recursive linear search methods. Additionally, students are tasked with reversing an array using both approaches and displaying results after each operation.

Uploaded by

Apala Mandal
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

Data Structures Lab

Arrays, Iterative and Recursive Methods


Course: [Link] (Computer Science & Engineering)
Year: First Year
Lab Topic: Arrays, Iterative Methods, Recursive Methods

Lab Exercises

Q1 (Easy – Basic Array Handling)


Write a program to:
1. Read n elements into an integer array.
2. Display the elements using an iterative method.
3. Print the sum and average of the array elements.

Q2 (Easy–Moderate – Iterative Processing)


Write a program to:
1. Find the largest and smallest element in an array using an iterative approach.
2. Count the number of even and odd elements present in the array.

Q3 (Moderate – Recursion with Arrays)


Write a recursive function to:
1. Calculate the sum of elements of an array.
2. Count the number of elements in the array that are greater than a given value k.

Q4 (Moderate–High – Iterative vs Recursive Comparison)


Write two separate programs (or functions) to perform linear search on an array:
1. Using an iterative method.
2. Using a recursive method.

For both implementations:


- Display whether the element is found or not.
- Compare the number of function calls/iterations for a given input.

Q5 (High – Decision & Application Based)


Write a program to:
1. Reverse an array using an iterative approach.
2. Reverse the same array using a recursive approach.
3. Display the array after each operation.

You might also like