Lab 1 - DSA
Lab 1 - DSA
Lab 01
INTRODUCTION TO DATA STRUCTURES
AND SHOW THE LARGEST NUMBER IN LINEAR ARRAY
Lab Objective:
Introduction to Data Structures and Algorithms.
Find the largest number in linear array of the user given numbers.
Lab Description:
Data Structures are the programmatic way of storing data so that data can be used efficiently. Almost every
enterprise application uses various types of data structures in one or the other way.
To solve the above-mentioned problems, data structures come to rescue. Data can be organized in a data
structure in such a way that all items may not be required to be searched, and the required data can be
searched almost instantly.
Space Complexity: Memory usage of a data structure operation should be as little as possible
Example
Problem: Design an algorithm to add two numbers and display the result.
Step 1 − START
Step 2 − declare three integers a, b & c
Step 3 − define values of a & b
Step 4 − add values of a & b
Step 5 − store output of step 4 to c
Step 6 − print c
Step 7 − STOP
Lab Task:
1. Make a program in C++ that finds the largest number of the user given array by using the above
algorithm.
2. Make the above algorithm with Do-While loop.