Profile

Cover photo
Nitish Mittal
Attended Dhirubhai Ambani Institute of Information and Communication Technology
Lives in Hyderabad
212 followers|50,453 views
AboutPostsPhotosYouTube

Stream

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

Shared publicly  - 
 
 
ISWC 2013 is the premier international forum for the Semantic Web / Linked Data Community. Here, scientists, industry specialists, and practitioners meet to discuss the future of practical, scalable, user-friendly, and game changing solutions.  #iswc2013 #semanticweb #datascience  
1

Nitish Mittal

Code/Snippets  - 
 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {

    public static void main(String[] args) throws IOException {
     
         int k = getInt();
         String s = getString();
      
         int n=0,m=1;
         int l = s.length();
         int no = (l*(l+1))/2;
         String[] sub = new String[no];
         int i =0;
         while(n<=l && i<no)
         {
             if(m==l+1){
                 n++;
                 m=n+1;
             }
             
                 sub[i] = s.substring(n,m);
                 
                 i++;
                 m++;
         }
         int total = 0;
         System.out.println(sub.length);
         for(int j=0;j<sub.length-1;j++)
         {
             for(int z=j+1;z<sub.length;z++)
             total = total + mismatch(sub[j],sub[z],k);
         }
         System.out.println(total);
         
     }
     public static int mismatch(String s1, String s2,int k)
     {
         char[] c1 = s1.toCharArray();
         char[] c2 = s2.toCharArray();
         int i=0;
         int n=0;
         int b = c1.length;
         int c = c2.length;
         while(i<b && b==c){
             if(c1[i]!=c2[i]) 
                 n++;
           
             i++;
         }
          // System.out.println(s1 + " " + s2 +" "+n);
        // System.out.println(k);
         if(n<=k && b==c){
         return 1;
         }
         else
             return 0;
     }
     
     public static String getString() throws IOException{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String s = br.readLine();
        return s; 
    }
    
    public static int getInt() throws IOException{
        String s = getString();
        return Integer.parseInt(s);
    }
}


in the line " int l = s.length();" i am getting NULLPOINTEREXCEPTION error can anyone suggest what wrong is there??
1
Add a comment...
 
#include<stdio.h>
#include<conio.h>

int main(){
   void (*p)();
   int (*q)();
   int (*r)();
   p = clrscr;
   q = getch;
   r = puts;
  (*p)();
  (*r)(" C Programming");
  (*q)();
  return 0;
}

what would be the output of this program?
2
Mapy ZONGO's profile photoFlorian Philipp's profile photoChris McClelland's profile photo
11 comments
 
I was curious to see how char read_write[] = "C Programming" is typically compiled, so I had a look: http://pastebin.com/raw.php?i=UU8N6xDZ
Add a comment...
Have him in circles
212 people
Suraj Sahuwala's profile photo
Tedwin Thomas's profile photo
anubhav maity's profile photo
ankit agarwal's profile photo
Ravi Mittal's profile photo
t.nitish Kumar's profile photo
Swena Gupta's profile photo
Prateek Agrawal's profile photo
Shirin Rajan's profile photo

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

How-To/Tutorials  - 
 
Hello Everyone!!!
I need a help, I want to find the probability of a word occurring given one or two previous words in a sentence. For example if sentence is " The color of rose is red" then what is the probability of occurring red given is and rose.
Any kind of link of Api or research articles would be helpful
1
Add a comment...

Nitish Mittal

Shared publicly  - 
 
hats off Google
1
People
Have him in circles
212 people
Suraj Sahuwala's profile photo
Tedwin Thomas's profile photo
anubhav maity's profile photo
ankit agarwal's profile photo
Ravi Mittal's profile photo
t.nitish Kumar's profile photo
Swena Gupta's profile photo
Prateek Agrawal's profile photo
Shirin Rajan's profile photo
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Hyderabad
Previously
gandhinagar
Links
Education
  • Dhirubhai Ambani Institute of Information and Communication Technology
    ICT, 2010 - 2014
Basic Information
Gender
Male