Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
Member Avatar for prakhs

I have an array of elements. Think each of the element as competitors, and a tournament is going to rank them. The output of the program is showing elements at each level. Here's the code: #include <stdio.h> #include <stdlib.h> bool isPowerOfTwo (int x) { /* First x in the below …

Member Avatar for iamthwee
0
238
Member Avatar for prakhs

Hi, I came across one question from codechef. [Click Here](http://www.codechef.com/problems/J7) Here, we are given P and S. Let l, b, h be the length, breadth, height of the box. we have these two inequalities 4*(l+b+h) <= P 2*(l*b+b*h+h*l) <= S We have to maximise the volume which is l*b*h. We …

Member Avatar for Adak
0
182
Member Avatar for prakhs

Hi, Please help me debug this code. I made a Stack template with two parameters: type and size. I am using it two times: first in conversion from infix expression to postfix (here, <char,50> stack is used), then in evaluation of postfix expression (here, <long double, 50> stack is used). …

Member Avatar for prakhs
0
939
Member Avatar for prakhs

Hi, can u all help me with a question. I have been given two boolean 2d square arrays. 1st array is one having random true or false values. 2nd array is with all true values. Suppose eg n = 4; 1st array : false true false true true true true …

Member Avatar for prakhs
0
362
Member Avatar for prakhs

#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int compare(const void * a, const void * b) { return strcmp(a, b); } struct node { char name[51]; int index; }; /* 1.Sort the Array cities (which was copy of A) and Array B2 (which was copy of B). 2.Do binary …

Member Avatar for prakhs
0
162
Member Avatar for prakhs
Member Avatar for prakhs

#include <stdio.h> #define MAXSIZE 100 int memo[MAXSIZE][MAXSIZE]; int aukermann(int m, int n) { if (memo[m][n] != -1) return memo[m][n]; if (m == 0) return (memo[m][n] = n + 1); else if (n == 0) return (memo[m][n] = aukermann(m - 1, 1)); else { memo[m][n-1] = aukermann(m, n-1); return (memo[m][n] = …

Member Avatar for dooma
0
174
Member Avatar for prakhs

#include <stdio.h> #include <malloc.h> struct node { int data; struct node *link; }; void append (int data, struct node **s) { struct node *p, *q; if (*s == NULL) { p = (struct node *) malloc (sizeof (struct node)); p->data = data; p->link = NULL; *s = p; return; } …

Member Avatar for deceptikon
0
139
Member Avatar for prakhs

http://www.codechef.com/problems/NUKES I'm getting time limit exceeded in my code... Please some one help me out with this code. My algorithm is when A - ((N+1) ^ (p+1)) < 0 then pth chamber will have 1 particle and the new value of A in my recursive function is A - ((N+1) …

Member Avatar for L7Sqr
0
638
Member Avatar for prakhs

#include <stdio.h> main() { char *s1, *s2; printf("Enter string 1 :"); scanf("%s", s1); printf("Enter String 2 :"); scanf("%s", s2); printf("%s\n%s", s1, s2); } The output of 1st string is right and the output of 2nd string is wrong (i.e. (null)) Can any 1 explain what is going behind?

Member Avatar for prakhs
0
197