Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

CSE3004 Design and Analysis of Algorithms

ELA Winter 2023-2024 Semester


Lab sheet -1 (L3+L4) and (L15+L16)

REG NO : 21BCE9056

NAME : BATHULA GURU SUBHASH

1. Write a programs to implement the following:

a) Prim’s algorithm.
Output:
b) Kruskal’s algorithm.
Output:
2. Create a Java class called Student with the following details as variables within
it. (i) USN (ii)Name (iii) Programme (iv) Phone. Write a Java program to create n
Student objects and print the USN, Name, Programme, and Phone of these objects
with suitable headings.
Output
3. Design a superclass called Staff with details as StaffId, Name, Phone, Salary.
Extend this classby writing three subclasses namely Teaching (domain,
publications), Technical (skills), and Contract (period). Write a Java program to
read and display at least 3 staff objects of all three categories.
OUTPUT :

You might also like