0% found this document useful (0 votes)
11 views

DSA Lab 1,2

This laboratory manual for the Data Structures and Algorithms course outlines the curriculum for the Fall 2024 session at BUITEMS, Quetta. It includes a certificate of completion for a student, a table of contents, course learning outcomes, and a list of experiments with detailed lab outcomes and tools required. The manual emphasizes practical implementation of data structures using programming tasks and provides rubrics for assessment.
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)
11 views

DSA Lab 1,2

This laboratory manual for the Data Structures and Algorithms course outlines the curriculum for the Fall 2024 session at BUITEMS, Quetta. It includes a certificate of completion for a student, a table of contents, course learning outcomes, and a list of experiments with detailed lab outcomes and tools required. The manual emphasizes practical implementation of data structures using programming tasks and provides rubrics for assessment.
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/ 16

LABORATORY MANUAL

Electrical Engineering Department

Data Structures and Algorithms

Submitted by

Mohammad Ahmed
Instructor
Miss. Bushra Haq
Assistant professor, Department of Computer Science,
Faculty of Information & Communication Technology, BUITEMS, Quetta.

Lab Engineer
Engr. Ali Israr
Lab Engineer, Department of Electrical Engineering,
Faculty of Information & Communication Technology, BUITEMS, Quetta.
Session Fall – 2024
LAB MANUAL Data Structures and Algorithms

CERTIFICATE

This is certified that Mr. M o h a m m a d A h m e d bearing CMS


ID # 59589

Successfully completed the laboratory manual of Data Structures and

Algorithms’ in his 5th semester of BS (Electrical Engineering), Batch Fall-2024

under the supervision of his lab instructor Engr. Ali Israr.

Lab Manual Marks Instructor Signature


LAB MANUAL Data Structures and Algorithms

TABLE OF CONTENTS

Contents

TABLE OF CONTENTS .................................................................................................................... 3


CLO’s PLO’s MAPPING .................................................................................................................. 4
List of Experiments........................................................................................................................ 5

LAB NO. 1 10/ 09 / 2024................................................................................................................ 6


Lab outcomes: ................................................................................................................................ 6
Corresponding CLO and PLO: ..................................................................................................... 6
Tools:.............................................................................................................................................. 6
Theory: ........................................................................................................................................... 6

LAB NO. 2 17/ 09 / 2024.............................................................................................................. 11


Lab outcomes: .............................................................................................................................. 11
Corresponding CLO and PLO: ................................................................................................... 11
Tools:............................................................................................................................................ 11
Observations: ............................................................................................................................... 15
LAB MANUAL Data Structures and Algorithms

CLO’s PLO’s MAPPING

Course Learning Outcomes


S# CLO Domain Taxonomy level PLO
1 Implement various data structures and their Cognitive 2 5
algorithms.
2 Design new data structures and algorithms Cognitive 5 3
to solve problems.
LAB MANUAL Data Structures and Algorithms

List of Experiments
List of Experiments
Sr.No CLO Experiments
1 1 Implementation of Array ADT.

2 1
Write a program to implement below array operations using method
“Insertion, Deletion, Traversing”
.
3 1

4 1 .

5 1

6 2 .

7 1 .

8 2

9 2

10 1

11 1

12 2

13 2

14 2
LAB MANUAL Data Structures and Algorithms

LAB NO. 1 10/ 09 / 2024


Implementation of Array
Lab outcomes:
After completing this lab, students will be able to.

 How to insert and print array elements.


 Display Array Elements Using Loop.
 Take Inputs from User and Store Them in an Array.

Corresponding CLO and PLO:


 CLO-1, PLO-5 (Modern Tool Usage)

Tools:
 Eclipse IDE
 JDK
 Dev C++

Theory:

The array is a basic abstract data type that holds an ordered collection of items accessible by
an integer index. These items can be anything from primitive types such as integers to more
complex types like instances of classes. Arrays have one property: they store and retrieve
items using an integer index. An item is stored in each index and can be retrieved at a later
time by specifying the same index. The way these indices work is specific to the
implementation, but you can usually just think of them as the slot number in the array that the
value occupies. Look at the image below:

Array:
An array is a type of linear data structure that is defined as a collection of elements with same or
different data types. They exist in both single dimension and multiple dimensions. These data
structures come into picture when there is a necessity to store multiple elements of similar nature
together at one place.
 Arrays are represented as a collection of buckets where each bucket stores one element. These
buckets are indexed from '0' to 'n-1', where n is the size of that particular array.

The basic operations in the Arrays are insertion, deletion, searching, display, traverse, and update.
These operations are usually performed to either modify the data in the array or to report the status of
the array.
LAB MANUAL Data Structures and Algorithms

Following are the basic operations supported by an array.


 Traverse - print all the array elements one by one.
 Insertion - Adds an element at the given index.
 Deletion - Deletes an element at the given index.
 Search - Searches an element using the given index or by the value.
 Update - Updates an element at the given index.
 Display - Displays the contents of the array.

Array syntax in c++ :-

data_type array_name [array_size] = {ELEMENTS OF ARRAY};


OR
Data_type array_name [array_size];

Task 1 : “Code With Array”

Output:

Task 2 : “Code without Array”


LAB MANUAL Data Structures and Algorithms

Output:

Task 3 : “Enter Array Elements”

Output:

Task 4: “PRINT ARRAY IN REVERSE ORDER”


LAB MANUAL Data Structures and Algorithms

Output:

Tasks 5: “PRINT ONLY 1ST POSITION ELEMENTS”

OUTPUT:
LAB MANUAL Data Structures and Algorithms

Rubrics:

Absent Student is Student can Student has Student has Student


unable to understand followed constructed perfectly
follow the the provided instructions the implemented a
provided laboratory to construct functional/ working
instructions instructions the working model/ logic/
properly. and familiar fundamental schematic/ circuit/ block
The student with the lab schematic/ model/ block diagram/ code
can name the environment block diagram/ And
Demonstration hardware or (Trainer/ diagram/ code, and successfully
simulation software/ code/ model have executed the
platform, but IDE), but on the successfully lab objective in
unable to cannot protoboard/ executed the Realtime or in
implement implement on trainer/ program/ run a simulation
anything the platform simulation circuit on environment
practically or practically or software. software and produced
on the software on the platform the desired
software results
Category Ungraded Very Poor Poor Fair Good Excellent
Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]
Marks 0.0 0.1 0.2 0.3 0.4 0.5
Date Total Marks Instructor’s Signature

Report not Plagiarized Requirements Observations Appropriate Correctly


submitted content are listed and are recorded computations drawn
presented or experimental along with or numerical conclusion
Laboratory incomplete procedure is detailed analysis is with
Reports submission presented procedure performed exact results
and complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]
Marks 0.0 0.1 0.2 0.3 0.4 0.5
Date Total Marks Instructor’s Signature
LAB MANUAL Data Structures and Algorithms

LAB NO. 2 17/ 09 / 2024

Write a program to implement below array operations using method “Insertion,


Deletion, Traversing”
Lab outcomes:
After completing this lab, students will be able to.

 How to Insert and print array elements.


 How to Delete array elements.
 How to Traverse array elements
 Display Array Elements Using Loop.

Corresponding CLO and PLO:


 CLO-1, PLO-5 (Modern Tool Usage)

Tools:
 Eclipse IDE
 JDK
 Dev C++

Theory:
LAB MANUAL Data Structures and Algorithms

Task-1:
LAB MANUAL Data Structures and Algorithms

Output

Task-2:
Write a program to swap first and last element of an integer 1-D array

Output
LAB MANUAL Data Structures and Algorithms

Task-3:
Write a program to reverse the element of an integer 1-D array.

Output

Task-4:
Write a program to merge to array using methods.
LAB MANUAL Data Structures and Algorithms

Output

Constrains:
Your method should take two arrays as arguments and return merged array

Observations:
in this lab we learned that How to insert and print array elements. we also get the knowledge to Display
Array Elements Using Loop and take Inputs from User and Store Them in an Array.
LAB MANUAL Data Structures and Algorithms

Rubrics:

Absent Student is Student can Student has Student has Student


unable to understand followed constructed perfectly
follow the the provided instructions the implemented a
provided laboratory to construct functional/ working
instructions instructions the working model/ logic/
properly. and familiar fundamental schematic/ circuit/ block
The student with the lab schematic/ model/ block diagram/ code
can name the environment block diagram/ and
Demonstration hardware or (Trainer/ diagram/ code, and successfully
simulation software/ code/ model have executed the
platform, but IDE), but on the successfully lab objective in
unable to cannot protoboard/ executed the Realtime or in
implement implement on trainer/ program/ run a simulation
anything the platform simulation circuit on environment
practically or practically or software. software and produced
on the software on the platform the desired
software results
Category Ungraded Very Poor Poor Fair Good Excellent
Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]
Marks 0.0 0.1 0.2 0.3 0.4 0.5
Date Total Marks Instructor’s Signature

Report not Plagiarized Requirements Observations Appropriate Correctly


submitted content are listed and are recorded computations drawn
presented or experimental along with or numerical conclusion
Laboratory incomplete procedure is detailed analysis is with
Reports submission presented procedure performed exact results
and complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]
Marks 0.0 0.1 0.2 0.3 0.4 0.5
Date Total Marks Instructor’s Signature

You might also like