This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Linked List class | |
//Author: Milon | |
import java.util.Scanner; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
//Node class | |
class Node{ | |
//Instance variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Queue using array | |
//Author: Milon | |
#include<iostream> | |
using namespace std; | |
#define MAX 5 // MAXIMUM CONTENTS IN QUEUE | |
class queue{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Queue | |
//Author: Milon | |
import java.util.NoSuchElementException; | |
//Node class | |
class Node{ | |
//Instance variable | |
private Object data; | |
private Node nextNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Mysql connection | |
//Author: Milon | |
//import java.sql.*; | |
import java.sql.Connection; | |
import java.sql.Statement; | |
import java.sql.PreparedStatement; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Directed graph | |
//Author: Milon | |
#include<iostream> | |
#include<cstdio> | |
using namespace std; | |
int main(){ | |
int n; | |
cout<<"Enter the number of nodes: "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Two Way Linked List | |
//Author: Milon | |
import java.util.NoSuchElementException; | |
//Node class | |
class Node{ | |
//Instance variable | |
private Object data; | |
private Node nextNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Directed graph | |
//Author: Milon | |
#include<iostream> | |
#include<cstdio> | |
using namespace std; | |
int main(){ | |
int n; | |
cout<<"Enter the number of nodes: "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Adjacency list | |
//Author: Milon | |
#include<iostream> | |
#include<cstdlib> | |
using namespace std; | |
struct list{ | |
int val; | |
struct list *next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Weighted graph | |
//Author: Milon | |
#include<iostream> | |
#include<cstdio> | |
using namespace std; | |
int main(){ | |
int n; | |
cout<<"Enter the number of nodes: "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Prime number check | |
//Author: Milon | |
#include<iostream> | |
using namespace std; | |
bool isPrime(int num){ | |
if(num<2) | |
return false; | |
for(int i=2;i<num;i++) |