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


Name : Kasireddy Bhoomika
Reg No : 21BCE9255
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 theUSN, 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), andContract (period). Write a Java program to
read and display at least 3 staff objects of all three categories.
Output

You might also like