Posts
 
Reputation
Joined
Last Seen
Ranked #928
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
26% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
3
Downvotes Received
15
Posts with Downvotes
7
Downvoting Members
13
5 Commented Posts
0 Endorsements
Ranked #4K
~12.7K People Reached
Favorite Tags
Member Avatar for shanki himanshu

the formula for naive bayes is P(A/B1,B2,B3...Bn) = [ P(A) * P(B1/A) * P(B2/A) * . . . P(Bn/A) ] / [ P(B1) * P(B2) *....P(Bn) ] i am working on a project to classify email as spam or not. i have a large data set. i am using nltk …

Member Avatar for shanki himanshu
0
159
Member Avatar for shanki himanshu

there is function : int median(int a[], int b[]) { } how do i find the number of elements in a and b? i am doing sizeof(a)/sizeof(int) but it does not give right results. P.S. i need to submit the function only in online compiler so i dont know what …

Member Avatar for shanki himanshu
0
373
Member Avatar for shanki himanshu
Member Avatar for shanki himanshu
0
136
Member Avatar for shanki himanshu
Member Avatar for Ancient Dragon
0
231
Member Avatar for shanki himanshu

i want to print a 'double' variable upto 8 decimal places without trailing zeroes. for eg: if a= **10.1234** then print **10.1234** if a= **10.00** then print **10** if a= **10.11111111111** then print **10.11111111** (max of 8 decimal places). how to do it? i searched for it and found this: …

Member Avatar for deceptikon
0
150
Member Avatar for shanki himanshu

why it doesnot works for values other than 0 and -1 i mean when i tried to print values of array 'a' after memset() then it shows incorrect values. int a[100]; memset(a,0,sizeof(a)); ///it works memset(a,-1,sizeof(a)); ///it works memset(a,1,sizeof(a)); ///it doesnt

Member Avatar for Tumlee
0
545
Member Avatar for shanki himanshu

what is the use of string.xml file in android? is it like defining global strings if we have multiple .java files in android application? correct me if i am wrong

Member Avatar for peter_budo
1
69
Member Avatar for shanki himanshu
Member Avatar for rithish
0
84
Member Avatar for straylight

@**rithish**...you print the string in reverse order. that not the question. you have to store it too. @**straylight**...your solution to **first part** is: 1. calculate length of string 2. find half of it.(take care of odd and even length) 3. run a loop from starting to length/2 and start swapping …

Member Avatar for rithish
0
1K
Member Avatar for shanki himanshu

Since in XOR linked list current pointer store the XOR of addresses of previous and next node. my question is how do we XOR two pointers?

Member Avatar for deceptikon
0
135
Member Avatar for shanki himanshu
Member Avatar for shanki himanshu

where is union required? please explain with an example where having union is a better choice than any data structure.

Member Avatar for deceptikon
0
125
Member Avatar for shanki himanshu
Member Avatar for I_m_rude
0
238
Member Avatar for ax33m144

2 loops are enough for all permutation of 'n' bit binary number. for(i=0;i<(1<<n);i++) {for(j=0;j<n;j++) { if(bit is set) print "1"; else print "0"; } }

Member Avatar for I_m_rude
0
2K
Member Avatar for I_m_rude

Xor all the numbers as you input them. at the end you will left with the number occurs once.

Member Avatar for Ancient Dragon
0
99
Member Avatar for shanki himanshu

struct abcd { char q; int w; //long int e; }; why size of this structure is 8 bytes and if i include **long int e** , size becomes 12 bytes?

Member Avatar for I_m_rude
0
104
Member Avatar for shanki himanshu

public class QueueImpl<E extends Comparable<E>> { private int count; private class Node { private E info; Node next; } Node front; Node rear; public E peekMaximum() { Node temp = new Node(); temp = front; Node max = new Node(); max = temp; while(temp!=null) { System.out.println(temp.info); //if(temp.info>max) if((temp).compareTo(max))>0) // getting …

Member Avatar for JamesCherrill
0
151
Member Avatar for shanki himanshu

int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i);

Member Avatar for _avishek
-1
117
Member Avatar for shanki himanshu

are these declaration same? const char *const s; char const *const s;

Member Avatar for sepp2k
0
58
Member Avatar for shanki himanshu

i am using strrev function and also included the header file string.h but i am getting the compile error **‘strrev’ was not declared in this scope**. what else is required?

Member Avatar for WaltP
0
2K
Member Avatar for shanki himanshu

#include<iostream> #include<math.h> using namespace std; int main() { long int t,n; cin>>t; while(t--) { cout<<"abc"; } return 0; } i am getting run time error for t>10000. how to solve it. range of t>1000000

Member Avatar for shanki himanshu
0
230
Member Avatar for shanki himanshu

i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not?

Member Avatar for Ancient Dragon
0
90
Member Avatar for shanki himanshu

struct node { int info; node *left,*right; }; int main() { struct node *root; root = (struct node*)malloc(sizeof(struct node)); root->info=NULL; root->left=NULL; root->right=NULL; if(root==NULL) printf("%d",root->info); return 0; } why it doesnt print root->info?

Member Avatar for I_m_rude
-1
155
Member Avatar for shanki himanshu

#include<iostream> #include<conio.h> using namespace std; struct node { int info; node *left,*right; }; int main() { struct node *root; root=NULL; //root->info=NULL; //root = (struct node*)malloc(sizeof(struct node)); if(root==NULL) //cout<<root->info; cout<<root->info<< " "<<root->left<<" "<<root->right<<"\n"; getch(); return 0; } why it is giving an error?

Member Avatar for MonsieurPointer
0
89
Member Avatar for shanki himanshu

int a=-3,b=2,c=0,d; d=++a&&++b||++c; printf("a=%d,b=%d,c=%d,d=%d",a,b,c,d); why value of 'c' is not incremented in output?

Member Avatar for Banfa
0
104
Member Avatar for shanki himanshu

char str[]="S\065AB"; printf("\n%d", sizeof(str)); explain the output. i am getting 5.

Member Avatar for Banfa
0
543
Member Avatar for shanki himanshu
Member Avatar for Ancient Dragon
0
133
Member Avatar for shanki himanshu

Why the program is running without line 14? #include<stdio.h> #include<iostream> //#include<conio.h> //#include<math.h> #define FOR(i,a,b) for(int i=a;i<b;i++) using namespace std; int main() { int a[]={1,2,3,4,5,6,7,8,9,10}; int *b; //b=(int *) malloc(sizeof(a)); b=a; //cout<<b; FOR(i,0,10) cout<<b[i]<<" "; //cout<<sizeof(b); //getch(); return 0; }

Member Avatar for shanki himanshu
0
97
Member Avatar for shanki himanshu

i am new to android application development. i have run hello world program only. now i want to run some sample code. when i try to run them i got this error in new dialog box: "Could not write file: C:\Program Files (x86)\Android\android-sdk\samples\android-15\SoftKeyboard\.project. C:\Program Files (x86)\Android\android-sdk\samples\android-15\SoftKeyboard\.project (Access is denied)" i …

0
67
Member Avatar for SDDMV