This file contains hidden or 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
public class LinkStack { | |
Node top; | |
public LinkStack(){ | |
top = null; | |
} | |
public LinkStack(Node a){ | |
top = a; |
This file contains hidden or 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
public class LinkedQueue { | |
Node front, rear; | |
LinkedQueue(){ | |
front = rear = null; | |
} | |
void insert( int n ){ | |
Node a = new Node(n); | |
if( front == null ){ | |
front = rear = a; | |
} |
This file contains hidden or 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
import java.util.*; | |
class Author | |
{ | |
int authorno; | |
String authorname; | |
Author() | |
{ | |
authorno=0; | |
authorname=""; | |
} |
This file contains hidden or 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
public class Personal { | |
String Name, Pan; | |
double basic_pay; | |
int acc_no; | |
Personal(String n, String p, double b, int a) { | |
//parametrized constructor | |
Name = n; | |
Pan = p; | |
basic_pay = b; | |
acc_no = a; |
This file contains hidden or 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
// http://www.respaper.com/isc/552/674.pdf | |
// Question 9 | |
import java.util.Scanner; | |
public class Alpha { | |
String str; | |
Alpha() { | |
//default constructor | |
str = ""; | |
} |
This file contains hidden or 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
import java.util.Scanner; | |
public class Combination { | |
int n, k; | |
Combination() { | |
//default constructor | |
//initialize data members to 0 or null | |
n = 0; | |
k = 0; | |
} | |
void read() { |
This file contains hidden or 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
import java.util.Scanner; | |
public class WordAlphabetical { | |
public static void main( String[] args ) { | |
Scanner in = new Scanner( System.in ) ; | |
System.out.println("Enter the sentence."); | |
String sentence = in.nextLine().toUpperCase(); | |
String[] words = sentence.split(" "); | |
for( int i=0;i<words.length;i++){ | |
for( int j=0;j<words.length;j++){ | |
if( words[i].compareTo(words[j])<0 ){ |
This file contains hidden or 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
import java.util.*; | |
class date | |
{ | |
public static void main(String args[]) | |
{ | |
Scanner in =new Scanner(System.in); | |
System.out.println("Enter the day number"); | |
int dayNumber=Integer.parseInt(in.nextLine()); | |
System.out.println("Enter the year"); | |
int year=Integer.parseInt(in.nextLine()); |
This file contains hidden or 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
import java.io.*; | |
public class Matrixm | |
{ | |
public static void main(String[] args)throws Exception | |
{ | |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); | |
//input | |
System.out.println("Please enter the order of the first matrix"); |
This file contains hidden or 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
import java.util.Scanner; | |
public class Encryption { | |
public static void main( String[] args ){ | |
//10181179401 --> 104 97 118 101 --> have | |
Scanner in = new Scanner( System.in ); | |
System.out.println("Input the stuff"); | |
String input = in.nextLine(); | |
//looping variable | |
int i = input.length()-1; | |
//store the ascii value |