Posts

Showing posts with the label Myself

Implementing Queue In Java

import java.util.*; class arrayQueue {     protected int Queue[] ;     protected int front, rear, size, len;     //Constructor     public arrayQueue(int n)     {         size = n;         len = 0;         Queue = new int[size];         front = -1;         rear = -1;     }       //Function to check if queue is empty     public boolean isEmpty()     {         return front == -1;     }       //Function to check if queue is full     public boolean isFull()     {         return front==0 && rear == size -1 ;     }       //Function to get the size of the queue     public int getSize()     {         return len ;  ...

Anagrams In Java ISC ICSE CBSE Class 12

import java.util.*; class Anagram{     public static void main(){         String s;         Scanner sc=new Scanner(System.in);         System.out.println("Enter a word");         s=sc.next();         Anagram ob=new Anagram();         ob.display("",s);     }     public void display(String p,String w){         if(w.length()<=1)         System.out.println(p+w);         else{             for(int i=0;i<w.length();i++){             String a=w.substring(i,i+1);             String b=w.substring(0,i);             String c=w.substring(i+1);             display(p+a,b+c);         }     } ...

Encoding In Java ISC CBSE Class 12

import java.util.*; class Encode{     public static void main(){         Scanner sc=new Scanner(System.in);         String s,t="",str="",p;         int c,k,l;         System.out.println("Enter the code");         s=sc.next();         l=s.length();         if(l>200){             System.out.println("Invalid Code");             return;         }         for(int i=l-1;i>=0;i--){             c=s.charAt(i)-48;             c=9-c;             t=t+Integer.toString(c);         }         for(int j=0;j<=l;j+=2){             p=t.substring(j,j+2);       ...

Integer To Roman In Java ISC CBSE Class 12

class Roman{     public void accept(int n){      int c=0,i,j;      int a[]={1000,900,500,400,100,90,50,40,10,9,5,4,1};      String aa[]={"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"};          if(n>9999){              System.exit(1);             }             else{             for(i=0;i<=12;i++){                 c=n/a[i];                 if(c!=0){                 for(j=1;j<=c;j++)                 System.out.print(aa[i]);             }                 n=n%a[i];             }     ...

ABOUT MYSELF

Hello everyone I am Anik Sarkar from Kolkata (India).I'm in high school now about to graduate next year. I'm an average student having interest in maths and computer.  I am here to share my thoughts and views.I don't understand blogging much but here I am to share my views and thoughts with you.