Posts
 
Reputation
Joined
Last Seen
Ranked #925
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.5K 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
158
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
370
Member Avatar for shanki himanshu
Member Avatar for shanki himanshu
0
135
Member Avatar for shanki himanshu
Member Avatar for Ancient Dragon
0
230
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
149
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
539
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
67
Member Avatar for shanki himanshu
Member Avatar for rithish
0
83
Member Avatar for straylight

I am attempting to reverse a string for a homework assignment and then reverse each word in the string. The trick is we are suppose to code it without using functions. Like "I like cats" should be 1st "stac ekil I" and then "cats like I". Here is what I …

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
124
Member Avatar for shanki himanshu
Member Avatar for I_m_rude
0
227
Member Avatar for ax33m144

Using C-Programming nested for() loops, write a program that displays all possible combinations of a 6 bit binary number. **Sample Run: 000000, 000001, 000010, 000011, ...........111110, 111111** Can anybody please help me in solving this question?

Member Avatar for I_m_rude
0
2K
Member Avatar for I_m_rude

we are getting i/p of 5,00,000 numbers ranging from 0 to 10^9 one by one. all numbers appears twice except one. We have to tell that number in the most efficient way. Any idea or just a hint to get this ? no code, no algo nothing i want. i …

Member Avatar for Ancient Dragon
0
98
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
150
Member Avatar for shanki himanshu

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

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

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

Member Avatar for sepp2k
0
57
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
228
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
89
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
154
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
103
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
531
Member Avatar for shanki himanshu
Member Avatar for Ancient Dragon
0
132
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
96
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

[CODE]#include <stdio.h> #include <stdlib.h> int add(int i, int j , int k) { while ( i != 0) { j = i % 10; k = k * j; i = i / 10; } return k; } int main () { int num, num2=1, r; int ret=1; int i=0; …

Member Avatar for MonsieurPointer
0
124