int palin(char *p)
{
int x=0;
while(*p)
{
x^=1(*p-'a');
p++;
}
int i=0,count=0;
while(i26)
{
count+=(1i x)i;
i++;
}
if(count1)
return 0;
else
return 1;
}
--
You received this message because you are
Given an array of size n, print all the possible subset of array of
size k.
eg:-
input:
a[]={1,2,3,4}, k = 2
output:
1,2
1,3
1,4
2,3
2,4
3,4
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@Someshwar Chandrasekaran
yea I think you are right. because to cross river, in the last we must have
one person new and other person who came back from other end.
this happens only in case of three.
Solution is possible up two three persons.
when you have four person in the last move you are
Hello folks,
I have seen some of the best possible string/array/tree based problems being
discussed on this thread but somehow i feel this group has been little
partial towards Graph problems.
Though, in most cases, interviewers don't ask Graph algorithms, but we, as
algo lovers, should give due
a is a pointer to somewhere where string is written..
p is a pointer to somewhere where new sring is written.
temp is made to point at same location to which a is currently pointing that
is at string
by malloc some new memory is alloted and a is made to point to thast
memory.. temp remains to
i think this problem can be solved easily for any no of ppl if they
are crossin the river using one shoe at a time :D :P
On Jul 26, 10:38 am, sunny agrawal sunny816.i...@gmail.com wrote:
For N=3, if the people are named A,B, and C:
A wears the shoes and carries B across the river.
is there
Hi
Dont u think the subsets will also be
{2,1}
{3,1}
{3,2}
{4,1}
{4,2}
{4,3}
On Tue, Jul 26, 2011 at 11:59 AM, sumit sumitispar...@gmail.com wrote:
Given an array of size n, print all the possible subset of array of
size k.
eg:-
input:
a[]={1,2,3,4}, k = 2
output:
1,2
1,3
1,4
2,3
Nybody got shortlisted in MS written test which happened on 23rd july???
On Sun, Jul 24, 2011 at 7:32 PM, Bhanu Pratap Singh bp.mn...@gmail.comwrote:
We can also use, c++ map... for implementing this!
--
*with regards ...
Bhanu P Singh (B!||-I~)
B.Tech Final Year
Computer Science And
@ankur, i think 1,2 and 2,1 would be same as set theory.. CMMIW.
following is the code..
#include stdio.h
#include stdlib.h
void print_comb(int *a, int len)
{
int tlen = len;
int i, j, k;
for (i=0;i5;i++) {
for (j=i+1; j4;j++) {
anyway, the code i posted is buggy.. doesn't work for k=3.. don't use it :)
On Tue, Jul 26, 2011 at 1:02 PM, Vishal Thanki vishaltha...@gmail.com wrote:
@ankur, i think 1,2 and 2,1 would be same as set theory.. CMMIW.
following is the code..
#include stdio.h
#include stdlib.h
void
#include bitset
#include iostream
#include math.h
#include vector
int main() {
using namespace std;
int arr[] = {1,2,3,4};
int k = 2;
int n = sizeof(arr)/sizeof(int);
vectorint v(arr, arr+n);
int l = pow(2.0, n);
for (int i = 0; i l; ++i) {
bitset32 b(i);
if (b.count() != k)
continue;
for (int j
WHY SO.. PLZ DONT DO THIS.
*WITH BEST REGARDS :
AASHISH SUMAN
MCA FINAL YEAR
*
*NIT DURGAPUR*
*+91-9547969906*
--
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
Problem statement goes as :
Consider square root of integers form 1 to 100. Now partition the
square roots of integers as being from 1 to 50 and 51 to 100.
Now find the sum in the two partitions which is as close as possible
or minimum?
Give the algorithm ?? and das structures to be used??
--
Has the results come ?
On Jul 26, 12:32 pm, $hr! k@nth srithb...@gmail.com wrote:
Nybody got shortlisted in MS written test which happened on 23rd july???
On Sun, Jul 24, 2011 at 7:32 PM, Bhanu Pratap Singh bp.mn...@gmail.comwrote:
We can also use, c++ map... for implementing this!
why are you spamming ?
On Tue, Jul 26, 2011 at 1:23 PM, wilson alexander aaalex0...@gmail.comwrote:
Hi,
Kindly unsubscribe my group algogeeks.
*...Regards,*
*A.Alex*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
Hi,
I want to implement an algorithm to determine the shortest path from the top to
down.
like:
int py_path_shoretest(int size, int **map); // return the shortest path value.
size is the height.
int main(void)
{
int map = {
{1},
{2, 3},
It dont look like a tree
its more like a triangle
and if the values are stored in the matrix can be simply done using a
Dynamic Programming bottom up approach
On Tue, Jul 26, 2011 at 2:27 PM, Charlotte Swazki
charlotteswa...@yahoo.frwrote:
Hi,
I want to implement an algorithm to determine
Do inorder traversal and maintain a bit vector equal to height of tree also
keep an current shortest path bit vector
in last print path using shortest path bit vector.
keep updating shortest path bit vector when path shorter than current
shortest path is found.
On Tue, Jul 26, 2011 at 9:57 AM,
#includeiostream
#includestring.h
using namespace std;
#define N(e) e#e
int main()
{
int i=1,j=2,k=3;
int m = i++ || j++ k++;
couti j k m;
}
output :-2 2 3 1
http://www.ideone.com/0sKBr
can anybody explain ? why are ++j and ++k are not evaluating even though
operator should be evaluated
Replace || by and then j and k will get evaluated.
The thing is that i think when the compiler sees a || operator ,if the
first operand is true than it wont check for the second.Thus j and k are not
getting evaluated.
On Tue, Jul 26, 2011 at 2:46 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
Donno..thats y am asking whether ny of u guyz shortlisted.
On Tue, Jul 26, 2011 at 1:50 PM, Ankuj Gupta ankuj2...@gmail.com wrote:
Has the results come ?
On Jul 26, 12:32 pm, $hr! k@nth srithb...@gmail.com wrote:
Nybody got shortlisted in MS written test which happened on 23rd july???
This will be evaluated as i++ || (j++ k++) as gets the priority, so i
will get incremented to 2. As the left hand side of || is true, the result
is true and so the right hand side won't get evaluated.
--
You received this message because you are subscribed to the Google Groups
Algorithm
how can u save this value in a int type variable...without using
abstract data type.
112223355569990
--
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD
--
You received this message because you are
Love your idea Navneet, but I have seen in general that Graph algos are
difficult to convert into code (at least for me!) May be that's the reason
why people are not discussing it here.
But like you pointed out we could at least point the scenarios where graph
algos can be applied. Looking
We can store their freq. as in run-length encoding, each dig freq. would
require 1/2 byte storage .10 digits would require 5 bytes = 2 integer type
variables or LL int .Digit seq. don't need to be stored coz they appear one
after another beginning from 1.
--
You received this message because you
check this link and let me know if anything wrong:
http://rajeevprasanna.blogspot.com/2011/07/is-given-characters-of-string-form.html
On Tue, Jul 26, 2011 at 11:37 AM, Anika Jain anika.jai...@gmail.com wrote:
int palin(char *p)
{
int x=0;
while(*p)
{
x^=1(*p-'a');
awesome answer..yeah it works..
On 7/26/11, SkRiPt KiDdIe anuragmsi...@gmail.com wrote:
We can store their freq. as in run-length encoding, each dig freq. would
require 1/2 byte storage .10 digits would require 5 bytes = 2 integer type
variables or LL int .Digit seq. don't need to be stored
for(i=sz-2;i=0;i--)
for(j=0;j=i;j++)
ar[i][j]+=min(ar[i+1][j],ar[i+1][j+1]);
coutar[0][0];
is this fine.?
--
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
exactly what nithish has stated is the reason..as all the programming
languages uses short circuit method of evaluation for the relational
statements..as the right side expression of the 'or' is true..it
doesn't evaluate the left side expression, because now the left side
expression doesn't affect
@ Raghvendra thanks dude
On Mon, Jul 25, 2011 at 7:20 PM, raghavendhra rahul
rahulraghavend...@gmail.com wrote:
hi ,
i think this s the link for algorithm for interviews ebook
http://code.google.com/p/interview/downloads/detail?name=Algorithms%2Bfor%2BInterviews%2B%28scan%2Bocr%29.pdf
all graph problem need not use tree . most of them can be implemented using
array .
On Tue, Jul 26, 2011 at 3:11 PM, Dipankar Patro dip10c...@gmail.com wrote:
Love your idea Navneet, but I have seen in general that Graph algos are
difficult to convert into code (at least for me!) May be that's
You can take a string with k no. of 1's at the end and generate all
possible permutations of the string thus formed.Doing this way you can
generate all possible strings and corresponding to each 1 in string
write the number in array(corresponding to that position) and thus you
can generate all
what is the password for the above mentioned book its not opening! ;'(
--
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
int main()
{
buildsubsets(0,0,);
}
void buildsubsets(int i,int j,String subset)
{
if(j==k)
{
coutsubset+ ;
return ;
}
for(;in;++i)
buildsubsets(i+1,j+1,subset+arr[i]);
}
assume that given arr[] is a character array i.e.
Hi Bhanu,
I downloaded the book but it does not ask any password.Why is it asking
password on your machine?
On Tue, Jul 26, 2011 at 4:31 PM, Bhanu Pratap Singh bp.mn...@gmail.comwrote:
what is the password for the above mentioned book its not opening! ;'(
--
You received this message
please explainthe code
#includestring
using namespace std;
int main()
{
int x=0;
string str;
cinstr;//only lowercase
for(int i=0;istr.size();i++) x^=(1(str[i]-97));
if(str.size()1)
{ if(!(x(x-1)))coutPalindrome\n;
else coutNot palindrome\n;
}
else
{if(!x)coutPalindrome\n;
but in precedence order || . Checked the same in dennis ricthie.
On Tue, Jul 26, 2011 at 2:53 PM, rajeev bharshetty rajeevr...@gmail.comwrote:
Replace || by and then j and k will get evaluated.
The thing is that i think when the compiler sees a || operator ,if the
first operand is true
On Tue, Jul 26, 2011 at 2:56 PM, Ankur Khurana ankur.kkhur...@gmail.com wrote:
but in precedence order || . Checked the same in dennis ricthie.
and || both have the same precedence.
There is a shorthand pattern of evaluation for the expressions.
learning that will help
Regards,
B.C.Someshwar
Well here is one good tutorial on Topcoder
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=usingTries.May be
this can help you.
On Sun, Jul 24, 2011 at 3:51 AM, Akash Mukherjee akash...@gmail.com wrote:
sorry if it seems to be off the topic, but any good resources for trie
for a
here is one good tutorial on topcoder
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=usingTries May be
this can help you.
On Sun, Jul 24, 2011 at 3:51 AM, Akash Mukherjee akash...@gmail.com wrote:
sorry if it seems to be off the topic, but any good resources for trie
for a newbie??
Hi vivek...
i don't know !!
Can u please mail me your copy of the book Vivek!! I shall be obliged!!
--
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
Guys this problem generated lot of discussion in computer science as ist
Euler Problem
as it involves maths stuff rather then considering tree (it wont work check
below link for detail ) or applying computer science . Also problem is
already famous (Euler problem ) as we have to find the
check this link:
*http://www.stefan-pochmann.info/spots/tutorials/sets_subsets/*
On Tue, Jul 26, 2011 at 11:59 AM, sumit sumitispar...@gmail.com wrote:
Given an array of size n, print all the possible subset of array of
size k.
eg:-
input:
a[]={1,2,3,4}, k = 2
output:
1,2
1,3
1,4
2,3
Given an array of integers, for each element of the array, print the
first number on the right side of the element which is smaller than
it. print -1 is there is no such element.
eg: 3,4,2,18,19,1,10
Ans: 2,2,1,10,10,-1,-1
O(n^2) solution is trivial.
One solution could be:
Insert the elements
if geeks are Really Interested in Application of Graph then why not start
from Now :)
1. if you click on any orkut member's name you will notice the relationship
for both of you indicating through whom you are interconnected or in certain
cases you won't get this path. if you have to propose
Use stack
On Tue, Jul 26, 2011 at 5:22 PM, Shikhar shikharko...@gmail.com wrote:
Given an array of integers, for each element of the array, print the
first number on the right side of the element which is smaller than
it. print -1 is there is no such element.
eg: 3,4,2,18,19,1,10
Ans:
Sorry for the above mistakeits not O(n)
On Tue, Jul 26, 2011 at 5:29 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
Use stack
On Tue, Jul 26, 2011 at 5:22 PM, Shikhar shikharko...@gmail.com wrote:
Given an array of integers, for each element of the array, print the
first number on
@piyush: Just curious, how exactly can a stack be used in this
problem?
On Jul 26, 5:00 pm, Piyush Sinha ecstasy.piy...@gmail.com wrote:
Sorry for the above mistakeits not O(n)
On Tue, Jul 26, 2011 at 5:29 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
Use stack
On Tue, Jul
The O/P of ur example should be 2,2,1,1,1,-1,-1
or am I getting it wrong ??
--
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
@ankit: you are right...sorry about the error
On Jul 26, 5:11 pm, ankit sambyal ankitsamb...@gmail.com wrote:
The O/P of ur example should be 2,2,1,1,1,-1,-1
or am I getting it wrong ??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
@Piyush, using stack i guess it can be done in O(n)
On Tue, Jul 26, 2011 at 5:42 PM, Shikhar shikharko...@gmail.com wrote:
@ankit: you are right...sorry about the error
On Jul 26, 5:11 pm, ankit sambyal ankitsamb...@gmail.com wrote:
The O/P of ur example should be 2,2,1,1,1,-1,-1
or am I
a crude algo,
for(i=end to start)
{
while(!stk.empty())
{
if(arr[i]arr[stk.top])
pop();
else
break;
}
if(!stk.empty())
l = arr.length-1;
else
l = stk.top;
output[i]=l-i-1;
stk.puch(i);
}
This will be O(n). Correct me I am wrong anywhere..
On Tue, Jul 26, 2011 at 5:49 PM,
#includestdio.h
#includestddef.h
struct node{
int a;
char *b[5];
struct node *link;
};
main()
{
int a;
a=sizeof(struct node);
printf(%d,a);
getchar();
return 0;
}
Whats the output..?
--
You received this message because you are
28.?
int a- 4
Five array of pointer to char 20( each pointer of 4 bytes)
struct node * 4 bytes.
On Tue, Jul 26, 2011 at 6:10 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
#includestdio.h
#includestddef.h
struct node{
int a;
char *b[5];
struct node *link;
};
4+20+4 = 28 bytes it should be i think
On Tue, Jul 26, 2011 at 6:10 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
#includestdio.h
#includestddef.h
struct node{
int a;
char *b[5];
struct node *link;
};
main()
{
int a;
a=sizeof(struct node);
@Akshata : Plz explain ur algo... Its not clear.
Like in the first iteration,
else
l = stk.top;
is getting executed. but stack is empty, so how r u assigning value to l
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
can anyone please tell me how to do hashing with strings..just
wanna confirm...and most importantly what is the use of it...i have
never used it
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
sorry for the typo ankit, its
if(stk.empty())
l = arr.length-1;
else
l = stk.top;
On Tue, Jul 26, 2011 at 6:19 PM, ankit sambyal ankitsamb...@gmail.comwrote:
@Akshata : Plz explain ur algo... Its not clear.
Like in the first iteration,
else
l = stk.top;
is getting executed. but
@Shikhar
1) Push the first element to stack.
2) for i = 1 to n-1
a) temp =a[i]
b) while(stack not empty)
int x = pop(stack)
if(xtemp) print(temp);
else
push(x,stack)
break;
c) push(temp,stack)
3) After the
I have no idea on what the 1st question is about as i have never used
orkut...
1. Regarding the 2nd one. Maintain a adjacency list for both the
user's friends.
2. Move through the friends of user 1 and mark them grey.
3. Move through the user 2 friends and mark them grey if not marked
and mark
A string hash function typically takes a string as an argument and
returns an integer which can be used as an index into a hash table
which allows it to be found quickly. The purpose is to relate a string
to something else in an efficient way. For instance, a symbol table
which stores variable
No, it might be possible for one person to carry two people.
On Jul 26, 12:38 am, sunny agrawal sunny816.i...@gmail.com wrote:
For N=3, if the people are named A,B, and C:
A wears the shoes and carries B across the river.
is there any condition that one can carry only one with him?
On Tue,
It is a *pair* of shoes, after all.
Don
On Jul 26, 2:16 am, subashree sridhar subashreesrid...@gmail.com
wrote:
i think this problem can be solved easily for any no of ppl if they
are crossin the river using one shoe at a time :D :P
On Jul 26, 10:38 am, sunny agrawal sunny816.i...@gmail.com
why isn't padding done here? We have seen previous posts on size of
structures, where due to padding, the size was not just the sum of size of
datatypes, but also padded bytes.
like here, int (4 bytes), then why is 3 bytes not padded after this, before
char* arr[5] (20 bytes)?
On Tue, Jul 26,
thanks for the info...i saw a method of using 4 bytes of string
together and then add them and finally take a modulusdoing such a
complex thing ...is thr any way to recover the string back using the
key only.can you give an example where you have seen using hashing
with strings...that
@rshetty: do u mean the sum of any no of elements separately in the
two partitions be equal to each other..? is that what u mean..?
On 7/26/11, rShetty rajeevr...@gmail.com wrote:
Problem statement goes as :
Consider square root of integers form 1 to 100. Now partition the
square roots of
@akshata: here padding wont come into picture coz int a =4byte, char
*b[5]=4*5byte, *link=4byte all are multiple of 4 . ans will be 28 byte
On Tue, Jul 26, 2011 at 6:42 PM, Akshata Sharma
akshatasharm...@gmail.comwrote:
why isn't padding done here? We have seen previous posts on size of
Doing such a complex thing reduces collisions and makes hashing effective..
Well, I didnt get you fully on dat 4 bytes of string together ...
I think u should refer to Article 6.6, Chapter 6(Structures) in The
C programming Language by Dennis Rtchie book..
Its very well explained there...!!
The
Usually a hash function is one-way, meaning that you can't recover the
original string. That is because there are many more possible values
for the string than for the hash index, making the hash function a
many-to-one relationship.
A very common hash function which I believe was mentioned in
A reasonable guess would be 28 bytes. But the size of a structure is
implementation dependent, and therefore, some other result could be
correct as well.
Don
On Jul 26, 7:40 am, Puneet Gautam puneet.nsi...@gmail.com wrote:
#includestdio.h
#includestddef.h
struct node{
int a;
Anyone having the Google Resume book pdf?
--
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.
Hi,
Print all the substrings of a given string. Is there any
solution better than O(n^2).
Eg: abc the possible substrings are {a,b,c,ab,bc,abc}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Dipankar, Thanks!!!
On Tue, Jul 26, 2011 at 8:44 AM, Dipankar Patro dip10c...@gmail.com wrote:
Swetha,
'\' in C is used to denote a escape sequence in C strings (and also in many
other languages).
e.g '\n' is for New Line '\n' is counted as one character.
Now '\ooo' is for an ASCII in
+1
Pls send to my email id as well..
On Tue, Jul 26, 2011 at 7:09 PM, Akshata Sharma
akshatasharm...@gmail.comwrote:
Anyone having the Google Resume book pdf?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
@everyone:
I have this mind strangling doubt..!!!
Why is char *s[5] of 20 bytes...?
yes the output is 28...
On 7/26/11, Don dondod...@gmail.com wrote:
A reasonable guess would be 28 bytes. But the size of a structure is
implementation dependent, and therefore, some other result could be
char *s[5] is an array of 5 char pointers. A pointer is an int, of size 4
bytes. So, 5*4 = 20 bytes
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
@everyone:
I have this mind strangling doubt..!!!
Why is char *s[5] of 20 bytes...?
yes the output is 28...
On
char *s[5] is a array of pointers of type char . but the thing is size of
pointers is 4byte irrespective of its type . coz address is always an
unsigned int which is of 4byte.
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
@everyone:
I have this mind strangling
You have an array like ar[]= {1,3,2,4,5,4,2}. You need to create
another array ar_low[] such that ar_low[i] = number of elements lower
than or equal to ar[i] in ar[i+1:n-1].
So the output of above should be {0,2,1,2,2,1,0}
Time complexity : O(nlogn)
use of extra space allowed.
--
*Piyush
ok...!
#includestdio.h
#includestddef.h
struct node{
int a;
char b[5];
struct node *link;
};
main()
{
int a;
a=sizeof(struct node);
printf(%d,a);
getchar();
return 0;
}
why is its output : 16?
Sudnt it be 4(int a) +5(char b[5]
Its Cos that is pointer and all pointers is 4 bytes address..
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
@everyone:
I have this mind strangling doubt..!!!
Why is char *s[5] of 20 bytes...?
yes the output is 28...
On 7/26/11, Don dondod...@gmail.com
for the above mentioned code, in previous post,: shudnt the output be 4+5+4=13?
On 7/26/11, Prem Krishna Chettri hprem...@gmail.com wrote:
Its Cos that is pointer and all pointers is 4 bytes address..
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam
puneet.nsi...@gmail.comwrote:
@everyone:
I
On Tue, Jul 26, 2011 at 7:18 PM, Piyush Sinha ecstasy.piy...@gmail.com wrote:
You have an array like ar[]= {1,3,2,4,5,4,2}. You need to create
another array ar_low[] such that ar_low[i] = number of elements lower
than or equal to ar[i] in ar[i+1:n-1].
So the output of above should be
padding..
4 byes int + 3 padding bytes + 5 char bytes + 4 bytes pointer =16
On Tue, Jul 26, 2011 at 7:22 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
for the above mentioned code, in previous post,: shudnt the output be
4+5+4=13?
On 7/26/11, Prem Krishna Chettri hprem...@gmail.com wrote:
the link ll not occupy any m/y here...so its output ll be 14(int -4
bytes,ptr-2 bytes);;if i'm wrong jst crct it...
On 7/26/11, Prem Krishna Chettri hprem...@gmail.com wrote:
Its Cos that is pointer and all pointers is 4 bytes address..
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam
@kavitha, what is m/y?
On Tue, Jul 26, 2011 at 7:27 PM, kavitha nk kavithan...@gmail.com wrote:
the link ll not occupy any m/y here...so its output ll be 14(int -4
bytes,ptr-2 bytes);;if i'm wrong jst crct it...
On 7/26/11, Prem Krishna Chettri hprem...@gmail.com wrote:
Its Cos that is
sry memory...
On 7/26/11, Akshata Sharma akshatasharm...@gmail.com wrote:
@kavitha, what is m/y?
On Tue, Jul 26, 2011 at 7:27 PM, kavitha nk kavithan...@gmail.com wrote:
the link ll not occupy any m/y here...so its output ll be 14(int -4
bytes,ptr-2 bytes);;if i'm wrong jst crct it...
hoe to find the combination and permutation for a given string?
On 7/26/11, swetha rahul swetharahu...@gmail.com wrote:
Hi,
Print all the substrings of a given string. Is there any
solution better than O(n^2).
Eg: abc the possible substrings are {a,b,c,ab,bc,abc}
--
You
pls explain the questi dint get it..
On 7/26/11, Dipankar Patro dip10c...@gmail.com wrote:
Puneet,
you missed out the 'sorted' part of array. Your code works fine for
randomized array.
+1 to Manish's solution. I had the same algo :)
On 26 July 2011 00:33, Puneet Gautam
Sum of any number of elements on the two partitions should be as close as
possible.
On Tue, Jul 26, 2011 at 6:49 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
@rshetty: do u mean the sum of any no of elements separately in the
two partitions be equal to each other..? is that what u mean..?
It is not 28 ?
4 sizeof(int) + 20 + 4 (ptr). And no padding, cos' all is mutiple of 4.
On Jul 26, 7:40 am, Puneet Gautam puneet.nsi...@gmail.com wrote:
#includestdio.h
#includestddef.h
struct node{
int a;
char *b[5];
struct node *link;
};
main()
{
@saurabh::gets too could be used
//BE COOL// kavi
--
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
On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam
puneet.nsi...@gmail.comwrote:
@everyone:
I have this mind strangling doubt..!!!
Why is char *s[5] of 20 bytes...?
5 x sizeof (*s). do you see ?
--
You received this message because you are subscribed to the Google Groups
Algorithm
sry frendzma above posts were wrongans is 28 if ptr takes 4 bytes...
//BE COOL// kavi
--
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,
test or text ??
On Tue, Jul 26, 2011 at 7:52 PM, kavitha nk kavithan...@gmail.com wrote:
@saurabh::gets too could be used
//BE COOL// kavi
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
will there be any difference in size on 32 machine and on 64 bit machine ?
how and what ?
On Tue, Jul 26, 2011 at 7:58 PM, kavitha nk kavithan...@gmail.com wrote:
sry frendzma above posts were wrongans is 28 if ptr takes 4
bytes...
//BE COOL// kavi
--
You received this message
DFS or BFS traversal would do to find the relationships in a network of
friends .
Traverse the graph and appropriately find the nodes (friends) which are at
one level below in a graph(tree).
As Linkedin does , it finds people connected to you at various levels of
depth as people connected at
what is meant by padding in self_referenced structure?
Is it always necessary?
--
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
yes
on a 64 bit machine ans will be 4+5*8+8 = 52 bytes
pointers take 8 byte on 64 bit machine
On Tue, Jul 26, 2011 at 8:00 PM, vaibhav shukla vaibhav200...@gmail.comwrote:
will there be any difference in size on 32 machine and on 64 bit machine ?
how and what ?
On Tue, Jul 26, 2011 at 7:58
what is meant by padding in self_referenced structure?
Is it always necessary?
--
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
yup .. I know... I missed dat out...!
But say , the array is random sorted, then is there an O(N) solution?
On 7/26/11, Dipankar Patro dip10c...@gmail.com wrote:
Puneet,
you missed out the 'sorted' part of array. Your code works fine for
randomized array.
+1 to Manish's solution. I had
1 - 100 of 197 matches
Mail list logo