This repository contains all the programs of the Design and Analysis of Algorithm Lab for the 2017 Scheme
Create a Java class called Student with the following details as variables within it.
- USN
- Name
- Branch
- Phone
Write a Java Program to create n Student objects and print the USN,Name,Branch and Phone of these objects with suitable headings.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Student.java
Write a Java Program to implement the stack using arrays. Write Push() , Pop() , and display() methods to demonstrate its working.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Stack.java
Design a superclass called Staff with details as StaffId,Name,Phone and Salary. Extend this class by writing three subclasses namely Teaching(domain,publication) , Technical(staff) and Contract(period). Write a Java Program to read and display atleast 3 staff objects of all three categories.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Inheritance.java
Write a Java class called Customer to store their name and date_of_birth. The date_of_birth format should be dd/mm/yyyy. Write methods to read customer data as <name,dd/mm/yyyy> and display as <name,dd,mm,yyyy> using StringTokenizer class considering the delimiter character as "/"
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/StringTokeniser.java
Write a Java program to read two integers a and b. Compute a/b and print,when b is not zero. Raise an exception when b is equal to zero.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Exception.java
Write a Java program that implements a multi-thread application that has three threads. First Thread generates a random number for every 1 second. Second thread computes the square of the number and prints. Third thread will print the value of cube of the number.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/MultiThreading.java
Sort a given set of n integer elements using Quick Sort method and compute its time complexity. Run the program for varied values of n>5000 and record the time taken to sort. Plot a graph of the time taken versus n on graph sheet. The elements can be read from a file or can be generated using the random number generator. Demonstrate using Java how the Divide-and-Conquer method works.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Quicksort.java
Sort a given set of n integer elements using Merge Sort method and compute its time complexity. Run the program for varied values of n>5000 and record the time taken to sort. Plot a graph of the time taken versus n on graph sheet. The elements can be read from a file or can be generated using the random number generator. Demonstrate using Java how the Divide-and-Conquer method works.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Mergesort.java
Implement in Java, the 0/1 Knapsack problem using Dynamic Programming
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/KnapsackA.java
Implement in Java , the 0/1 Knapsack problem using Greedy method
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/KnapsackB.java
From a given vertex in a weighted connected graph , find the shortest paths to other vertices using Dijkstra's Algorithm. Write the program in Java.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Dijkstra.java
Find Minimum Cost Spanning Tree of a given connected undirected graph using Kruskal's algorithm. Use Union-Find algorithms in your program.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Kruskal.java
Find Minimum Cost Spanning Tree of a given connected undirected graph using Prim's algorithm.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Prims.java
Write Java program to implement All-Pairs Shortest Paths problem using Floyd's algorithm
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Floyds.java
Write a Java program to implement Travelling Salesman Problem(TSP)
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/TSP.java
Design and implement in Java to find a subset of a given set S = {s1,s2,...,sn} of n positive integers whose SUM is equal to a given positive integer d. Display a suitable message , if the given problem instance dosent have a solution.
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Subset.java
Design and implement in Java to find all Hamiltonian Cycles in a connected undirected graph G of n vertices using backtracking principal
CODE : https://github.com/infiniteoverflow/VTU-DAA-LAB/blob/master/Hamiltonian.java