Skip to content

Instantly share code, notes, and snippets.

View paramsingh's full-sized avatar

param paramsingh

View GitHub Profile
@paramsingh
paramsingh / LinkStack.java
Created March 13, 2013 13:54
Linked Stack
public class LinkStack {
Node top;
public LinkStack(){
top = null;
}
public LinkStack(Node a){
top = a;
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;
}
import java.util.*;
class Author
{
int authorno;
String authorname;
Author()
{
authorno=0;
authorname="";
}
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;
// http://www.respaper.com/isc/552/674.pdf
// Question 9
import java.util.Scanner;
public class Alpha {
String str;
Alpha() {
//default constructor
str = "";
}
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() {
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 ){
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());
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");
@paramsingh
paramsingh / Encryption.java
Created February 8, 2013 10:29
Encryption question.
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