check this out...
http://groups.google.com/group/algogeeks/browse_thread/thread/be213f8937b02858?hl=en#
On Thu, Jul 28, 2011 at 10:00 PM, shubham shubh2...@gmail.com wrote:
answer is:
1 hr 20 mins.
But i don't know how to arrive at the solution.
help anyone..
--
You received
x^(x^x) - (x^x)^x = 0
Thus, x^(x^x) = (x^x)^x
Let's open it up by taking log on both sides...
(x^x)*log(x) = x* log(x^x)
(x^x)*log(x) = x*x*log(x)
If x==1 equation is satisfied as log(x) becomes 0..
so x=1 is definitely a solution. what if when x != 1
cancelling log(x) on both the sides..
x^x =
Let S be the exact amount for which minimum coins are to found. And denom[]
be the array which contains different denominations. Let N be the size of
the denom[] array.
Algo:
1. int memo[S]
2. initialize all its elements to infinite
3.for i=1 to S
for j=0 to N-1
if(denom[j] i
@reynald: this won't work for floatsis there any other case u can
think of, where this method won't work??
2011/7/29 A for ♥ღAakasHღ♥ littleidol...@gmail.com
a=(a+b)-(b=a);
*Aakash Abhishek Pradhan**
**MCA Final Year,
NIT Durgapur*
--
You received this message because you are
If a cow produces its first she-calf at age two years and after that
produces another single she-calf every year, how many she-calves are
there after 12 years? assuming none die.
and a similar one, asked to another guy,
Suppose a newly-born pair of rabbits, one male, one female, are put in
a
an array containing +ve and -ve integers.find sub array with the largest
sum
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
Can you please explain the logic behind this algo in detail...
On Fri, Jul 29, 2011 at 11:32 AM, ankit sambyal ankitsamb...@gmail.comwrote:
Let S be the exact amount for which minimum coins are to found. And denom[]
be the array which contains different denominations. Let N be the size of
the
For 2nd,
Are you looking for this? /lib/modules/kernel_versionbuild/ ?
Or the kernel image? It can be found under /boot/. But that depends
upon the distribution, there is no symbolic link present for kernel
image as far as i know.
On Fri, Jul 29, 2011 at 9:45 AM, rajeev bharshetty
I'm not familiar with Choco in particular but you are probably trying
to post an element constraint.
Make sure that the index variable has a domain inside the range of the
array on which you apply the element (-1 should not be in the domain).
On Jul 29, 1:24 am, hafsainfo haafsa...@gmail.com
Write and implement an algorithm to find the nth Fibonacci number,
optimized for space and time.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
symbolic link /boot/vmlinuz will point to the actual kernel executable(or
image).
/lib/modules are modules that can be loaded if required.
google for vmlinuz or lib modules for more info.
-
Azhar.
On Fri, Jul 29, 2011 at 11:54 AM, Vishal Thanki vishaltha...@gmail.comwrote:
For 2nd,
Are you
can be found in lg(n) using Matrix Exponential method
| 1 1 |^n
| 1 0 |
[f(i) f(i-1)]* |1 1| = [f(i+1) f(i)]
|1 0|
On Fri, Jul 29, 2011 at 12:05 PM, Reynald reynaldsus...@gmail.com wrote:
Write and implement an algorithm to find the nth Fibonacci number,
optimized for space
please give the solution for this problem...
Give an algorithm to find the Longest common string of strings with lengths
m,n respectively and also analyse their time complexities
--
AMAN AGARWAL
Success is not final, Failure is not fatal: It is the courage to continue
that counts!
--
You
I have used dynamic programing to solve the problem. I have used memo[]
array to memoize the value of previous state.
You should take an example and try to work it out using the algo...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
String need to be contiguous or not ?
On Fri, Jul 29, 2011 at 12:23 PM, AMAN AGARWAL mnnit.a...@gmail.com wrote:
please give the solution for this problem...
Give an algorithm to find the Longest common string of strings with lengths
m,n respectively and also analyse their time
Replying to all the Above Code.
1 XOR operation to swap variable are not a solution as it fails for
swapping of same value results 0.
2 the Short and Sweet looking various modification of code fails to swap
data when U swap data between two different data type.
So I suggest you all guys to use
solutions for cow questions:
if we consider first cow would she calf at age 2 then first new cow
would come at age two.
at end of 2nd year: 1st would give new cow:
at end of 3rd year:1st cow would another new cow
at end of 4th year :1st cow will give new cow and the cow born at end
of 2nd year
Thanks, but also one small doubt
If x=y=z=-4 then plz tell me o/p of
pf(++x++y||++z) and pf(x,y,z) these two statements.
On Fri, Jul 29, 2011 at 10:52 AM, jagrati verma jagrativermamn...@gmail.com
wrote:
vijay x=y=z=-1
so for ++x++y||++z
++x=0
so 1st condition will get false so
1
and
-3 -3 -4..
Verify the Compilation..
Regards
Prem
On Fri, Jul 29, 2011 at 12:35 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
Thanks, but also one small doubt
If x=y=z=-4 then plz tell me o/p of
pf(++x++y||++z) and pf(x,y,z) these two statements.
On Fri, Jul
Yes , so can u explai me plz, i m little bit confusing..Vijay
On Fri, Jul 29, 2011 at 12:39 PM, Prem Krishna Chettri
hprem...@gmail.comwrote:
1
and
-3 -3 -4..
Verify the Compilation..
Regards
Prem
On Fri, Jul 29, 2011 at 12:35 PM, Vijay Khandar
this is very popular interview question i also want solution.
On Jul 29, 11:19 am, jagrati verma jagrativermamn...@gmail.com
wrote:
an array containing +ve and -ve integers.find sub array with the largest
sum
--
You received this message because you are subscribed to the Google Groups
Thanks Prem got it now...
On Fri, Jul 29, 2011 at 12:44 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
Yes , so can u explai me plz, i m little bit confusing..Vijay
On Fri, Jul 29, 2011 at 12:39 PM, Prem Krishna Chettri hprem...@gmail.com
wrote:
1
and
-3 -3
Short and Easy..
Operation Check both side (if not Zero) B4 verifying the result
|| operation Check only either side.Depends on the precedence on which it
applies.
Now Work it Out.
On Fri, Jul 29, 2011 at 12:44 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
Yes , so can u explai me plz, i
Thanks.
On Fri, Jul 29, 2011 at 12:46 PM, Prem Krishna Chettri
hprem...@gmail.comwrote:
Short and Easy..
Operation Check both side (if not Zero) B4 verifying the result
|| operation Check only either side.Depends on the precedence on which it
applies.
Now Work it Out.
On Fri,
Do u want the subarray consisting of consecutive elements ???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
@Shivnarayan
As per the analysis from the number of cows produced from the she-calves of
the 1st cow, I get the foll numbers:
1+2+4+7+11+16+22+29+38+48+59+1(MainCow) = 238.
Correct me If am wrong.
Regards
Hemalatha
On Fri, Jul 29, 2011 at 11:45 AM, Reynald reynaldsus...@gmail.com wrote:
If
can u give an explanation for ...how xor method fails for same values??
I think it will work right...
On Fri, Jul 29, 2011 at 12:26 PM, Prem Krishna Chettri
hprem...@gmail.comwrote:
Replying to all the Above Code.
1 XOR operation to swap variable are not a solution as it fails for
swapping
http://en.wikipedia.org/wiki/XOR_swap_algorithm
Answer as well as broaden you guys Concept on Memory..
Have a look
On Fri, Jul 29, 2011 at 12:54 PM, tech rascal techrascal...@gmail.comwrote:
can u give an explanation for ...how xor method fails for same values??
I think it will work right...
Shivnarayan, why should we add all Fibonacci number? Since 1+1 both digits
represent the same cow. I think the last Fibonacci is the answer.
I'm sorry if I'm wrong.
On Fri, Jul 29, 2011 at 12:53 PM, Hemalatha
hemalatha.amru...@googlemail.com wrote:
@Shivnarayan
As per the analysis from the
kadane's algo...google it
On Fri, Jul 29, 2011 at 12:52 PM, SAMMM somnath.nit...@gmail.com wrote:
Do u want the subarray consisting of consecutive elements ???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
Yess ... For
For example :-
F(n) = | 1 1 |^n
| 1 0 |
For calculating a^n ... use the Exponential method Here a will be
your Matrix ..
int result (int a,int n)
{
int x=1,y=a;
while(n0)
{
if(n%2==1) x=(x*y); /* Instead of X=1 i(n case of
ODD ) substiute
yeah thanxgot it
this won't work if memory locations of both variables is same
On Fri, Jul 29, 2011 at 1:03 PM, Prem Krishna Chettri hprem...@gmail.comwrote:
http://en.wikipedia.org/wiki/XOR_swap_algorithm
Answer as well as broaden you guys Concept on Memory..
Have a look
On Fri,
you refer cormen too
On Jul 29, 11:19 am, jagrati verma jagrativermamn...@gmail.com
wrote:
an array containing +ve and -ve integers.find sub array with the largest
sum
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
@RAHUL SINGHAL
Sorry to bother you!
Unfortunately I cant find any such links in topcoder. Can you just share a
link here!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
No ans will be sum of all
final fib. number is the no of she-calves of age 0
second last is number is she-calves of age 1
...and so on
so answer is sum of all
On Fri, Jul 29, 2011 at 1:09 PM, Reynald Suz reynaldsus...@gmail.comwrote:
Shivnarayan, why should we add all Fibonacci number? Since
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=alg_index
On Fri, Jul 29, 2011 at 1:31 PM, Rahul Menon menonrahul1...@gmail.comwrote:
@RAHUL SINGHAL
Sorry to bother you!
Unfortunately I cant find any such links in topcoder. Can you just share a
link here!
--
You received this
would it work
temp=root;
for(int i=0;ik;i++)
{
temp=temp-left;
}
On Jul 29, 10:48 am, sunny agrawal sunny816.i...@gmail.com wrote:
Node* x = TREE_MINIMUM(root);
for(int i = 0; i k-1; i++){
x = TREE-SUCCESSOR(x);}
return x;
On Fri, Jul 29, 2011 at 11:08 AM, noobcoder
what do you mean when u say
initialize all its elements to infinite.
i am not able to get this logic.
memo[i-denom[j]] +1 memo[i] can you please explain???
On Fri, Jul 29, 2011 at 11:32 AM, ankit sambyal ankitsamb...@gmail.comwrote:
Let S be the exact amount for which minimum coins
It means a very large value, can be the max value that an integer can
hold
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
what do u mean by
memo[i]=memo[i-denom[j]] +1
memo[i] will be containing infinite value.
memo[i-denom[j]] will also contain infinite value
On Fri, Jul 29, 2011 at 11:32 AM, ankit sambyal ankitsamb...@gmail.comwrote:
Let S be the exact amount for which minimum coins are to found. And
If u have to sort a large amount of data,but the memory space is
insufficient for the same...How would u sort the data..?
Reply asap everyone..
Thanks in advance...!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
Longest common sub sequence
complexity O(n*n);
Have you ever studied DAA ?
On Fri, Jul 29, 2011 at 12:25 PM, sunny agrawal sunny816.i...@gmail.comwrote:
String need to be contiguous or not ?
On Fri, Jul 29, 2011 at 12:23 PM, AMAN AGARWAL mnnit.a...@gmail.comwrote:
please give the solution
Hey everyone , pls tell me how testcases of following:
1. 3 sides of a triangle are taken, output whether its obstuse,
scalene,isosceles..?
2. testcases of a duster...
I know nothing about testcases, so pls reply accordingly..!!
--
You received this message because you are subscribed to the
Hi,
pls tell me which data structure has following representation::
A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).??
reply asap...!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
SLL... Bit Field (best optimisation)...
On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
Hi,
pls tell me which data structure has following representation::
A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).??
reply asap...!!
--
You received this message because
Array that that stores A,B,C,D,E.
it looks like u r on some telephonic interview :P
On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
Hi,
pls tell me which data structure has following representation::
A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).??
reply
B Trees data structures are optimal for such problems.
These algorithms help to access large amount of data which we cannot fit
into main memory .
On Fri, Jul 29, 2011 at 2:58 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
If u have to sort a large amount of data,but the memory space is
You can use a Hash map which maps the coefficients of the equation and their
exponents.
Is this feasible ??
On Fri, Jul 29, 2011 at 3:10 PM, sunny agrawal sunny816.i...@gmail.comwrote:
Array that that stores A,B,C,D,E.
it looks like u r on some telephonic interview :P
On Fri, Jul 29,
You have to use External Merge Sort.
--
On Fri, Jul 29, 2011 at 2:58 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
If u have to sort a large amount of data,but the memory space is
insufficient for the same...How would u sort the data..?
Reply asap everyone..
Thanks in advance...!
--
@nikhil: If i declare Char b after int c.., would there be any
difference...?
On 7/28/11, Nikhil Gupta nikhilgupta2...@gmail.com wrote:
Here's another example.
struct example
{
int a;
char b;
int c;
}
Now if a variable of type example is declared then
(considering base address as 2000)
@Anand: What is external merge sort...?
On 7/29/11, Anand Saha anands...@gmail.com wrote:
You have to use External Merge Sort.
--
On Fri, Jul 29, 2011 at 2:58 PM, Puneet Gautam
puneet.nsi...@gmail.comwrote:
If u have to sort a large amount of data,but the memory space is
insufficient
i think for rat pair answer should be same as cow..correct me if i am
wrong
On Jul 29, 1:10 pm, sunny agrawal sunny816.i...@gmail.com wrote:
No ans will be sum of all
final fib. number is the no of she-calves of age 0
second last is number is she-calves of age 1
...and so on
so answer is
I can tell u the logic if the minimum existing coin denomination is 1 cent
for instance.If the minimum denomination is not 1 u might need to modify the
algorithm I guess
let v1,v2.vn be the values of the coin denominations u have in the array
dynamic programming solution would be as follows:
It is just integer knapsack.
On Fri, Jul 29, 2011 at 11:34 AM, Arun Vishwanathan
aaron.nar...@gmail.comwrote:
I can tell u the logic if the minimum existing coin denomination is 1 cent
for instance.If the minimum denomination is not 1 u might need to modify the
algorithm I guess
let
i did a dry run on this code and didnt find the significance of mk array ...
so i did remove it from the code ..
and the code works fine ..
i more thing ... the code repeats same palindromes as in incase of ABA baa
is coming twice..
correct me if i am wrong ...
On Fri, Jul 29, 2011 at 10:47 AM,
please share the questions of facebook interviwe rounds, fb coming in
my coll on 5th..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email
@aman: My mistake.
set* memo[0]=0*
The revised algo is :
Algo:
1. int memo[S]
2. initialize all its elements to infinite. *
3.memo[0]=0*
4.for i=1 to S
for j=0 to N-1
if(denom[j] imemo[i-denom[j]] +1 memo[i])
memo[i]=memo[i-denom[j]] +1
5. return memo[S]
--
#includestdio.h
void add();
void subtract();
int main()
{int choice;
printf(enter your choice:1.add 2.subtract:);
scanf(%d,choice);
switch(choice)
{case 1:
add();
break;
default:
printf(wrong choice entered);
}
}
void add()
{int a,b;
char c;
do
{printf(enter two numbers:);
#includestdio.h
#includeconio.h
struc MyStructA {
char a;
char b;
int c;
};
struct MyStructB {
char a;
int c;
char b;
};
int main(void) {
struct MyStructA A;
struct MyStructB B;
int sizeA = sizeof(struct MyStructA);
int sizeB = sizeof(struct MyStructB);
return 0;
}
OUTPUT IS
A = 8
void printPerm(char *s,int i ,int len){
if( i == len){
printf(%s\n,s);
return ;
}
int j ;
char t ;
char h[26] ;
memset(h,'0',26);
for(j = i ; j len ; j++ ){
if(h[s[j]-'a'] == '0'){
h[s[j]-'a'] = '1' ;
t = s[i] ; s[i] = s[j] ; s[j] =
Rajeev, I think 'vmlinuz' file in /boot directory is the symbolic link to
kernel.
On Fri, Jul 29, 2011 at 9:45 AM, rajeev bharshetty rajeevr...@gmail.comwrote:
1 )System map in Linux is a Symbol table used by the kernel.
Mapping of symbol names and addresses.
2 ) IS it /usr/src/linux ???
Is that from a phone interview of MS? :-|
On Fri, Jul 29, 2011 at 2:32 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
Hey everyone , pls tell me how testcases of following:
1. 3 sides of a triangle are taken, output whether its obstuse,
scalene,isosceles..?
2. testcases of a duster...
I
external merge sort .
On Fri, Jul 29, 2011 at 10:54 AM, rajeev bharshetty rajeevr...@gmail.comwrote:
B Trees data structures are optimal for such problems.
These algorithms help to access large amount of data which we cannot fit
into main memory .
On Fri, Jul 29, 2011 at 2:58 PM, Puneet
this is the recursive code..Iterative does any1 know?
On Thu, Jul 28, 2011 at 7:58 AM, ambika iyer balu200...@gmail.com wrote:
@tushar : thnx!!
On Thu, Jul 28, 2011 at 8:11 PM, Tushar Bindal tushicom...@gmail.comwrote:
it should be O(n)
where n is number of nodes as we get into the
But in B-trees also we need to store large no of pointers in the main
memory. Wont that outrun memory space..?
Can we use B+ trees ..?Would that be any good..?
On 7/29/11, rajeev bharshetty rajeevr...@gmail.com wrote:
B Trees data structures are optimal for such problems.
These algorithms help
For all Folks..
DS question answer cannot be simple yes no. it is always the tradeoff of
Space and time Complexity.
On Fri, Jul 29, 2011 at 3:26 PM, rajeev bharshetty rajeevr...@gmail.comwrote:
You can use a Hash map which maps the coefficients of the
equation and their exponents.
Is this
If u have 2GB of data file which has one string per line and u have to sort
it, and X MB of memory is available.then divide the file into 'K' chunks of
X MB each. Bring each chunk into memory and sort lines by any usual O(nlgn)
algorithm \. Save the lines back to files.
D this for all chunks and
@sunny: well not really in an interview ..
its that adobe is coming 1st august to our college..
I found this question in its placement papers..!!!
I thought there might be a predefined ds for such representation...
What is an SLL..?
On 7/29/11, rajeev bharshetty rajeevr...@gmail.com wrote:
Join the given point with all the vertices of the triangle and calculate the
area of each of the three sub-triangles thus formed
now compare the area of original triangle with the sum of the area of those
3 triangles
if that comes out to be equal, then the point lies inside
otherwise not.
On Fri,
SLL = singly linked list
but i think array is better choice :)
On Fri, Jul 29, 2011 at 3:36 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
@sunny: well not really in an interview ..
its that adobe is coming 1st august to our college..
I found this question in its placement papers..!!!
I
The minimum number of multiplications required to evaluate the expression
a + bx + cx2 + dx3 + ex4 is
1). 4
2) 5
3). 3
4) 7how to solve these kind of questions...??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
4
a+x(b+x(c+x(d+ex)))
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
What is meant by the statement :
byte0 = (num x00FF) 0
And what is meant by the operators , ^ , , | and how are they
used?
--
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India
--
You received this message because you are subscribed to the
right shift.^ Xor, and,| OR operators...
the statement means u r anding the bits of num wid the bits in the
hexadecimal number x000FF and thn right shifting the bits by 0 number of
times( effectively in this case u wont be shifting)
On Fri, Jul 29, 2011 at 5:50 PM, Nikhil Gupta
Which College ??
On Fri, Jul 29, 2011 at 4:19 PM, azad azad.monik...@gmail.com wrote:
please share the questions of facebook interviwe rounds, fb coming in
my coll on 5th..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
for long strings, the values will be larger.
a simple approach could be to store occurrence of each char of both the
strings in an integer array of size 26 and if both the arrays are same then
the two strings are anagrams.
--
You received this message because you are subscribed to the
And what does ~ operator do?
On Fri, Jul 29, 2011 at 5:59 PM, aditi garg aditi.garg.6...@gmail.comwrote:
right shift.^ Xor, and,| OR operators...
the statement means u r anding the bits of num wid the bits in the
hexadecimal number x000FF and thn right shifting the bits by 0 number of
~ does bitwise not on the operand .
It simply inverts all the bits .
On Fri, Jul 29, 2011 at 7:09 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
And what does ~ operator do?
On Fri, Jul 29, 2011 at 5:59 PM, aditi garg aditi.garg.6...@gmail.comwrote:
right shift.^ Xor, and,| OR
#includeiostream
#includestring.h
using namespace std;
int main()
{
char str1[] = sdfgkirertyujvcheddirtyutrdfgrtyuigfkrertyuijhgfdshh;
char str2[] = redirtyhgfdshhrtyrsujvcheierdutrdfgrtyuigfkdfgktyuij;
int len1 = strlen(str1), len2 = strlen(str2);
if(len1 != len2)
{
well this one followed the well known horners rule,
On Fri, Jul 29, 2011 at 5:41 PM, Anurag Narain anuragnar...@gmail.comwrote:
4
a+x(b+x(c+x(d+ex)))
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
thank u:)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this
what would be the output of below program
#includestdio.h
#includeconio.h
void main()
{
clrscr();
static int a[5];
int i;
for(i=0;i=4;i++)
printf(\n%d,a[i]);
getch();
}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
or cin.ignore() or while(getchar()!='\n'0; instead of only a getchar.
On Fri, Jul 29, 2011 at 5:03 PM, sunny agrawal sunny816.i...@gmail.comwrote:
when you enter two numbers and press Enter
new line character is passed as character c
Change your code as Follows:
printf(do you want to
use a bitfield to optimize space
On Fri, Jul 29, 2011 at 7:14 PM, Siddharth kumar
siddhartha.baran...@gmail.com wrote:
#includeiostream
#includestring.h
using namespace std;
int main()
{
char str1[] = sdfgkirertyujvcheddirtyutrdfgrtyuigfkrertyuijhgfdshh;
char str2[] =
i more thing ... the code repeats same palindromes as in incase of ABA baa
is coming twice..
Put back mk array in place and baa won't be repeated.
The idea is that out of all available options for filling a particular
position in our partial solution at each round of backtracking we
choose for
0 0 0 0 0
On Fri, Jul 29, 2011 at 7:35 PM, Arshad Alam alam3...@gmail.com wrote:
what would be the output of below program
#includestdio.h
#includeconio.h
void main()
{
clrscr();
static int a[5];
int i;
for(i=0;i=4;i++)
printf(\n%d,a[i]);
getch();
}
0 0 0 0 0
u are taking array static which initialize its elements with zero :)
On Fri, Jul 29, 2011 at 7:38 PM, aditi garg aditi.garg.6...@gmail.comwrote:
0 0 0 0 0
On Fri, Jul 29, 2011 at 7:35 PM, Arshad Alam alam3...@gmail.com wrote:
what would be the output of below program
The seen array filters out the characters which are available for
filling a particular position.
The mk array makes sure that we choose only one of the repeated
characters.
for example,
if the array is aba
if mk array is there backtracking will try like
String : a _ _ or b _ _
Yes I agree static variables initialises with 0 but 0 will be at the very
first position of the array, so what about second, third ... positions of
array..why all those are also 0 but it should be any garbage value... please
clarify it.
On Fri, Jul 29, 2011 at 7:38 PM, sagar pareek
thanks ..
@siddhartha : i know the hashing technique ... and the problem of longer
strings can be reduced by subtracting a large constant value from the ASCII
value of all the characters .. and its not only with cubes even if u add
squares of ascii values ... i think it will work .
@saurabh : in
thank you
On 29 juil, 06:32, pschaus psch...@gmail.com wrote:
I'm not familiar with Choco in particular but you are probably trying
to post an element constraint.
Make sure that the index variable has a domain inside the range of the
array on which you apply the element (-1 should not be in
ignore above status...i was looking at two problems simulataneously...posted
on the wrong one...
apologies...really its embarrasing.
On Fri, Jul 29, 2011 at 8:11 PM, snehi jain snehijai...@gmail.com wrote:
thanks ..
@siddhartha : i know the hashing technique ... and the problem of longer
no problem ..
but can u find a bug in this technique ..
On Fri, Jul 29, 2011 at 8:17 PM, saurabh singh saurab...@gmail.com wrote:
ignore above status...i was looking at two problems
simulataneously...posted on the wrong one...
apologies...really its embarrasing.
On Fri, Jul 29, 2011 at 8:11
Things can go very bad in case the string length is large and mostly of non
priniting chars.
and wat if there are chars with negative ascii value?does ur logic handles
this situation?I doubt it does,
On Fri, Jul 29, 2011 at 8:21 PM, snehi jain snehijai...@gmail.com wrote:
no problem ..
but can
there was an typo,
if mk array is *not* there backtracking will try like
On Jul 29, 7:13 pm, amit karmakar amit.codenam...@gmail.com wrote:
The seen array filters out the characters which are available for
filling a particular position.
The mk array makes sure that we choose only one of the
That should work, but I'd bet that my method is faster.
Don
On Jul 29, 6:02 am, Udit Gupta uditgupta...@gmail.com wrote:
Join the given point with all the vertices of the triangle and calculate the
area of each of the three sub-triangles thus formed
now compare the area of original triangle
During declaration of static variables.. after assigning memory to all the
elements it initialize *ALL THE MEMORY ALLOTTED *members with zero...* *
On Fri, Jul 29, 2011 at 8:09 PM, Arshad Alam alam3...@gmail.com wrote:
Yes I agree static variables initialises with 0 but 0 will be at the very
ok thanx brother i got now
On Fri, Jul 29, 2011 at 9:07 PM, sagar pareek sagarpar...@gmail.com wrote:
During declaration of static variables.. after assigning memory to all the
elements it initialize *ALL THE MEMORY ALLOTTED *members with zero...* *
On Fri, Jul 29, 2011 at 8:09 PM,
@anika: Here is the iterative code:
void iter_mirror(Node *root)
{
if(root==NULL)
return;
Node *stack[100];
Node *temp,*temp1;
int top=-1;
stack[++top]=root;
while(top!=-1)
{
temp=stack[top];
temp1=temp-left;
temp-left=temp-right;
@vaibhav :Cool ...!!
thanks buddy..!
On 7/29/11, vaibhav shukla vaibhav200...@gmail.com wrote:
If u have 2GB of data file which has one string per line and u have to sort
it, and X MB of memory is available.then divide the file into 'K' chunks of
X MB each. Bring each chunk into memory and
1 - 100 of 169 matches
Mail list logo