Re: [algogeeks] Doubt on Regular Expression

2012-04-08 Thread bharat b
In regular expr, even a space is also a character. so u can exclude all those spaces(stay in the same state if u encounter a space character) in a word. On Wed, Apr 4, 2012 at 5:05 PM, atul anand atul.87fri...@gmail.com wrote: i am not sure , but wont x.trim() will remove extra spaces from the

Re: [algogeeks] Doubt on Regular Expression

2012-04-04 Thread atul anand
i am not sure , but wont x.trim() will remove extra spaces from the string... On Wed, Apr 4, 2012 at 12:32 AM, Debabrata Das debabrata.barunhal...@gmail.com wrote: Hi All, I was looking for an regular expression such that given a string X,it should exclude a token in single quote preceded

[algogeeks] Doubt on Regular Expression

2012-04-03 Thread Debabrata Das
Hi All, I was looking for an regular expression such that given a string X,it should exclude a token in single quote preceded by a particular string. e.g in java say. String X= 'abc ' like'abc ' ='abc' N.replaceall(reg expression ??) would transform it to : ?? like

[algogeeks] doubt in lca

2012-03-17 Thread rahul sharma
in binary tree.. suppose c is parent of dnow if i want to find least common ancesor of c and dwhther it is parent of c or c itself -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] doubt in lca

2012-03-17 Thread sunny agrawal
C itself On Sat, Mar 17, 2012 at 8:39 PM, rahul sharma rahul23111...@gmail.comwrote: in binary tree.. suppose c is parent of dnow if i want to find least common ancesor of c and dwhther it is parent of c or c itself -- You received this message because you are subscribed to the

Re: [algogeeks] doubt in lca

2012-03-17 Thread rahul sharma
thnx buddy...according to algo c is the answer. On Sat, Mar 17, 2012 at 8:42 PM, sunny agrawal sunny816.i...@gmail.comwrote: C itself On Sat, Mar 17, 2012 at 8:39 PM, rahul sharma rahul23111...@gmail.comwrote: in binary tree.. suppose c is parent of dnow if i want to find least common

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread rahul sharma
1-2-3-4-5-6-7-8-9-10-11 fast and slow meet at 11 m=6; k=4 ...i cant get last two lineswhen k= sometimes around the circle - m.. then after that taking fast at begining and slow within circle ..i cant get this...@ dave plz explain with this example...will b of gr8 help..thnx in

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread Moheed Moheed Ahmad
@Rahul: As Dev said: Now start the fast pointer at the head and take m single steps with both pointers. The fast pointer is at the beginning of the cycle, and the slow pointer has traversed the cycle (2*t - u) times and is back at the beginning of the cycle. k= (2*t-u)p -m When fast pointer is

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-10 Thread rahul sharma
@moheed i got it. @Dave...Thnx a lot..i got it all now... On Sat, Mar 10, 2012 at 5:56 PM, Moheed Moheed Ahmad mohe...@gmail.comwrote: @Rahul: As Dev said: Now start the fast pointer at the head and take m single steps with both pointers. The fast pointer is at the beginning of the cycle,

[algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread rahul sharma
i have 2 pointers fast and slow.now if tehy meet there is a loop... now keep one ptr at meeting point and take other one to the begining of listmove both at speed of one..they will meet at start of loophow this happens???why they meet at start..plz tell logic behind this???thnx in

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread sanjiv yadav
No They will not meet at the start in a case containing 5 nods and having loop at the third node. once check this On Fri, Mar 9, 2012 at 3:48 PM, rahul sharma rahul23111...@gmail.comwrote: i have 2 pointers fast and slow.now if tehy meet there is a loop... now keep one ptr at meeting

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread Terence
@ rahul sharma: the linked list is a combination of a list a-b-...-p-q and a cycle q-r-...-z-q. (z != p). noting that the start of cycle q is the only node with 2 predecessor: p and z. if 2 pointers meet at some node x, different from q, in last step they must have met at x', the predecessor

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread rahul sharma
@terencei cant get..can u eleboratethnx for the sol..but plz elaborate... On Fri, Mar 9, 2012 at 5:59 PM, Terence technic@gmail.com wrote: @ rahul sharma: the linked list is a combination of a list a-b-...-p-q and a cycle q-r-...-z-q. (z != p). noting that the start of cycle q

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread sanjiv yadav
suppose linked list is a-b-c-d-e and suppose loop starts from 'c' according to u let one pointer be at 'c' say *q and another be at 'a' say *p. Now if we move both at the speed of one then After first pass p will be at b q will be at d After second pass p will be at c q will be at e

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread rahul sharma
@sanjiv...how can u take q at c.they will meet at some position ... suppose u have 1-2-3-4-5-6-7-4 now initialy slow and fast both at 1 start incrementing slow by 1 and fast by 2 slow @2 ...fast @3 slow @3fast @5 s...@4...fast@7 slow @5...fast@5 both are equalmeans dere is

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread sanjiv yadav
I think u r making mistake i.e. after 7,5 will com not 4 because loop starts from 5.check it again On 3/9/12, rahul sharma rahul23111...@gmail.com wrote: @sanjiv...how can u take q at c.they will meet at some position ... suppose u have 1-2-3-4-5-6-7-4 now initialy slow and fast

Re: [algogeeks] Doubt in removing loop from linked list

2012-03-09 Thread rahul sharma
itz ryt...loop starts from 4 n not from 5... On Fri, Mar 9, 2012 at 8:58 PM, sanjiv yadav sanjiv2009...@gmail.comwrote: I think u r making mistake i.e. after 7,5 will com not 4 because loop starts from 5.check it again On 3/9/12, rahul sharma rahul23111...@gmail.com wrote:

[algogeeks] doubt about macro.......

2012-02-04 Thread rahul sharma
swap(a,b,c) c t;t=a;a=b;b=t; int main() { int g=1,h=2; swap(g,h,int); } how the actual values are replace??? a and b are replaced with g and hactual are replace..can somebody tell me expanded source code??? -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] doubt about macro.......

2012-02-04 Thread sharad dixit
Think #define as a simple text substitution macro. Assume you are the preprocessor. Copy/paste the exact code for the macro into the places where your program tried to use and then replace the macro parameters with the arguments that you used to invoke the macro. The advantage of a macro is that

Re: [algogeeks] doubt about macro.......

2012-02-04 Thread rahul sharma
yeahjust wana cnfm that parameters are replaced actually...thnx On Sat, Feb 4, 2012 at 4:40 PM, sharad dixit sharad.emine...@gmail.comwrote: Think #define as a simple text substitution macro. Assume you are the preprocessor. Copy/paste the exact code for the macro into the places where

Re: [algogeeks] doubt about macro.......

2012-02-04 Thread Manni mbd
int main () { int g= 1, h= 2; int t; t=g;g=h;h=t; } hope this helps On 2/4/12, rahul sharma rahul23111...@gmail.com wrote: swap(a,b,c) c t;t=a;a=b;b=t; int main() { int g=1,h=2; swap(g,h,int); } how the actual values are replace??? a and b are replaced with g and hactual are

Re: [algogeeks] doubt about macro.......

2012-02-04 Thread Varun
Yep..that's correct. In this context, I would like to understand a little more about inline functions? Other than they being a type sensitive compared to macro, what else differs them from macro, and does each call to inline function, does get replaced by its definition!. Any link, that can

Re: [algogeeks] Doubt in C++

2012-01-02 Thread Arun Vishwanathan
I just have a basic doubt..does the string s1,s2 statement call any default constructor?or is it that it is not performed since parameterised constructor is present? On Wed, Sep 21, 2011 at 1:31 AM, vijay singh vijaysinghb...@gmail.comwrote: It is because of the presence of the single

[algogeeks] doubt on normalization coding

2011-12-17 Thread rameshbabu kovuru
hai friends this is ramesh . i need c or cpp code for normalisation ,how the normlaiztion will be performed on a realtion up to third normal formplease... if any one knows about it please send that code ..please please... -- You received this message because you are subscribed to

Re: [algogeeks] doubt on normalization coding

2011-12-17 Thread atul anand
No homework post please. On Sat, Dec 17, 2011 at 6:26 PM, rameshbabu kovuru rameshbabukv...@gmail.com wrote: hai friends this is ramesh . i need c or cpp code for normalisation ,how the normlaiztion will be performed on a realtion up to third normal formplease... if any one knows about

Re: [algogeeks] doubt in spoj 8473 ways

2011-12-16 Thread anubhav raj
#includestdio.h #define s(n) scanf(%d,n) #define I int I a[14][14]; I d(I m,I n) { I s=a[m][n]; I k; if(!m||!n) k=1; else if(s) k=s; else { k=d(m-1,n)+d(m,n-1); s=k; } return k; } main() { I t,n,k;s(t); while(t--) { s(n); k=d(n,n); printf(%d\n,k); } } @saurav:this is the actual and very simple

Re: [algogeeks] doubt in spoj 8473 ways

2011-12-16 Thread sourabh singh
limit is just v.smll can ny1 help me with this code: [ c code ] get it under 120 bytes . is there any way to take inputs. without using scanf ??? in c . m thinking about inputs getting into argc array directly.??? #define s(n) scanf(%d,n); f(int n){return n==1?1:(n*f(n-1));} main() { int

[algogeeks] doubt in spoj .9529. Maya Calendar MAYCA

2011-12-16 Thread anubhav raj
this is my almost working code for spoj mayca ...can anyone suggest me anytest cases.for which it is not working.tnx in advance #includeiostream #includecstdio #includecstring using namespace std; char

[algogeeks] doubt in spoj 8473 ways

2011-12-15 Thread anubhav raj
we have to submit it in 120 byte cn ne 1 tl me dat whr z the chances of further byte reduction in this code. #includestdio.h #define s(n) scanf(%d,n) #define I int I a[14][14];I d(I m,I n){I s=a[m][n];I k;if(!m||!n)k=1;else if(s)k=s;else{k=d(m-1,n)+d(m,n-1);s=k;}return k;}main(){I

Re: [algogeeks] doubt in spoj 8473 ways

2011-12-15 Thread saurabh singh
Post the formatted code too.(With proper indents)Then it would be easier for others to work on it, On Thu, Dec 15, 2011 at 11:47 PM, anubhav raj anubhaw@gmail.com wrote: we have to submit it in 120 byte cn ne 1 tl me dat whr z the chances of further byte reduction in this code.

[algogeeks] doubt in TSUM

2011-12-14 Thread anubhav raj
hey guys ,i am trying to solve TSUM ..on spoj... http://www.spoj.pl/problems/TSUM/.in which we have to find the sum of any triplets in n numbers.can any one suggests me any approach other than brute-force of (n^3).. ..thanks in advance --

[algogeeks] Doubt in Lowest Common Ancestor

2011-11-03 Thread Ankuj Gupta
I have a doubt in calculating LCA. While calculating LCA of two nodes, should those two nodes can also be ancestor. As wikipedia states that The lowest common ancestor is defined between two nodes v and w as the lowest node in T that has both v and w as descendants (where we allow a node to be a

[algogeeks] doubt???

2011-09-28 Thread htross
There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -- 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

Re: [algogeeks] doubt???

2011-09-28 Thread anshu mishra
You cant do. -- 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

Re: [algogeeks] doubt???

2011-09-28 Thread Shreyas VA
Use 2 semaphores. pseudo code sem_1(1); sem_2(0); THREAD A;THREAD B sem_1_wait(); sem_2_wait(); ... sem_2_signal();

Re: [algogeeks] doubt???

2011-09-28 Thread Balaji
Shreyas solution would work. semaphores can be released for a thread that has not acquired it . Thanks, Balaji On Wed, Sep 28, 2011 at 7:41 PM, anshu mishra anshumishra6...@gmail.com wrote: You cant do. -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Doubt in templates

2011-09-24 Thread Ankuj Gupta
Hi I have written a simple template class. #include iostream using namespace std; template class T class vector { T *arr; int size; public: vector(int len) { arr = new T[size=len]; for(int i=0;ilen;i++)

[algogeeks] Doubt in C++

2011-09-20 Thread Ankuj Gupta
Consider a class class string { char *p; int len; public: string(char *a); }; string::string(char *a) { length = strlen(a); p= new char[length +1]; strcpy(p,a); } string s1,s2; char *name =test; s2=name; // statement Why does constructor gets called in

Re: [algogeeks] Doubt in C++

2011-09-20 Thread vijay singh
It is because of the presence of the single parameterised constructor in the class definition. So, if we are writing the following statement... string s1; s1=test; It'll call the single parameterised constructor. But this only true in the case of single value assignment as in the above

[algogeeks] doubt in c

2011-08-31 Thread priya ramesh
the following is a function which computes the double tree of a given tree. here is the description of a double tree. doubleTree() For each node in a binary search tree, create a new duplicate node, and insert the duplicate as the left child of the original node. The resulting tree should still

Re: [algogeeks] Doubt

2011-08-28 Thread Aditya Virmani
it runs perfectly for me on both 64 bit 32 bit... check again On Sun, Aug 28, 2011 at 2:20 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: The following C program segfaults of IA-64, but works fine on IA-32. *int* main() { *int p; p *=*

[algogeeks] Doubt regarding the escape sequences

2011-08-28 Thread ankit sablok
How can I store an escape sequence at each character of the string when i give the string as an input to the program? Can anybody suggest me something other than the method i mention below #includeiostream #includecstdio #includecstring using namespace std; int main() { char s[100];

Re: [algogeeks] Doubt

2011-08-28 Thread Deepak Garg
ya code is perfectly fine.no error On Mon, Aug 29, 2011 at 12:07 AM, sagar pareek sagarpar...@gmail.comwrote: Success http://www.ideone.com/ZFgEh On Sun, Aug 28, 2011 at 3:13 PM, Aditya Virmani virmanisadi...@gmail.comwrote: it runs perfectly for me on both 64 bit 32 bit... check

[algogeeks] Doubt

2011-08-21 Thread Nikhil Gupta
http://www.ideone.com/kRaMj I found this in the algogeeks forum only. Can anyone explain how value of i is still 0, but *p shows 2 although their addresses are the same. -- Nikhil Gupta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] Doubt

2011-08-21 Thread Ankur Khurana
can somebody please explain this ? On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: http://www.ideone.com/kRaMj I found this in the algogeeks forum only. Can anyone explain how value of i is still 0, but *p shows 2 although their addresses are the same. --

Re: [algogeeks] Doubt

2011-08-21 Thread Kamakshii Aggarwal
But on dev c it is showing o/p as 2 2 .. I too have a doubt,a similar question was asked in atrenta's written paper. On Sun, Aug 21, 2011 at 8:14 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: can somebody please explain this ? On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta

Re: [algogeeks] Doubt

2011-08-21 Thread rajeev bharshetty
Its 2 2 on gcc compiler. Some compilers support overwriting of the const variables which is usually a bug if program expects the value of a variable to be constant . Usually newer compilers don't show such bugs. On Sun, Aug 21, 2011 at 8:59 PM, Sanjay Rajpal srn...@gmail.com wrote: i was also

[algogeeks] Doubt !!!!!!

2011-08-14 Thread rShetty
Please explain this ... #includestdio.h int main() { int *p[10]; printf(%d,sizeof(*p)); return 0; } Output is 4 For this program #includestdio.h int main() { int *p[10][20]; printf(%d,sizeof(*p)); return 0; } Output is 80 (10*20*sizeof(int)) -- You received this message because

Re: [algogeeks] Doubt !!!!!!

2011-08-14 Thread Anika Jain
in the first code the output is 4 bcoz *p means *p[0] that means p[0] that is some address so for 32 bit machine its coming to be 4 bytes.. in the 2nd it is 80 as 20*sizeof(int *) and not as you mentioned.. On Sun, Aug 14, 2011 at 6:12 PM, rShetty rajeevr...@gmail.com wrote: Please explain this

Re: [algogeeks] Doubt !!!!!!

2011-08-14 Thread sagar pareek
@rshetty for the first code u have array as : --_ _ _ _ _ _ _ _ _ _ ( _ denotes block of int) so sizeof(*p) is ofcourse give you sze of int now u have int *p[10][20]; which can be viewed as _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Re: [algogeeks] Doubt !!!!!!

2011-08-14 Thread rajeev bharshetty
@anika and sagar : Thanks Got it. On Sun, Aug 14, 2011 at 6:25 PM, sagar pareek sagarpar...@gmail.com wrote: @rshetty for the first code u have array as : --_ _ _ _ _ _ _ _ _ _ ( _ denotes block of int) so sizeof(*p) is ofcourse give you sze of int now u have int *p[10][20]; which

[algogeeks] Doubt Related To Java

2011-08-11 Thread rahul rai
public class JoyOfHex { public static void main(String[] args) { System.out.println( Long.toHexString(0x1L + 0xcafebabe)); } } I got the problem from Java Puzzlers Book Here Is Their Explanation :: Decimal

Re: [algogeeks] Doubt

2011-08-04 Thread Gaurav Popli
actually the questn should go like this.wud that be good /optimised with space because we can use more storages for a tree without freeing them On Thu, Aug 4, 2011 at 10:09 AM, rajeev bharshetty rajeevr...@gmail.com wrote: Since you are maintaining two different data structures ,one for

[algogeeks] Doubt

2011-08-03 Thread Anurag Narain
suppose there is a binary tree and i am creating another tree which is same as the previous one. but while creating the new tree i am freeing the nodes of my old tree(i.e., i create one node in new tree and delete the corresponding node in old tree and continue the process till the new tree is

Re: [algogeeks] Doubt

2011-08-03 Thread Gaurav Popli
good quesn.i also want to knowjust in case On Thu, Aug 4, 2011 at 2:50 AM, Anurag Narain anuragnar...@gmail.com wrote: suppose there is a binary tree and i am creating another tree which is same as the previous one. but while creating the new tree i am freeing the nodes of my old

Re: [algogeeks] Doubt

2011-08-03 Thread rajeev bharshetty
Since you are maintaining two different data structures ,one for the old tree and the other for new tree . I think this isn't considered in-place algorithm . The algorithm to be in-place should not use any additional data structures . Correct me if I am wrong . On Thu, Aug 4, 2011 at 2:52 AM,

Re: [algogeeks] Doubt

2011-07-30 Thread Nikhil Gupta
Thanks. Is there any way to implement 2's compliment on binary numbers? On Fri, Jul 29, 2011 at 7:13 PM, rajeev bharshetty rajeevr...@gmail.comwrote: ~ does bitwise not on the operand . It simply inverts all the bits . On Fri, Jul 29, 2011 at 7:09 PM, Nikhil Gupta

Re: [algogeeks] Doubt

2011-07-30 Thread aditi garg
@nikhil..yea do ones complement by using ~ operator and thn add 1... On Fri, Jul 29, 2011 at 7:16 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Thanks. Is there any way to implement 2's compliment on binary numbers? On Fri, Jul 29, 2011 at 7:13 PM, rajeev bharshetty

[algogeeks] Doubt

2011-07-29 Thread Nikhil Gupta
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

Re: [algogeeks] Doubt

2011-07-29 Thread aditi garg
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

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread Siddharth kumar
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

Re: [algogeeks] Doubt

2011-07-29 Thread Nikhil Gupta
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

Re: [algogeeks] Doubt

2011-07-29 Thread rajeev bharshetty
~ 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

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread Siddharth kumar
#includeiostream #includestring.h using namespace std; int main() { char str1[] = sdfgkirertyujvcheddirtyutrdfgrtyuigfkrertyuijhgfdshh; char str2[] = redirtyhgfdshhrtyrsujvcheierdutrdfgrtyuigfkdfgktyuij; int len1 = strlen(str1), len2 = strlen(str2); if(len1 != len2) {

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread saurabh singh
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[] =

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread snehi jain
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

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread saurabh singh
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

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread snehi jain
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

Re: [algogeeks] doubt in checking if 2 strings are anagrams

2011-07-29 Thread saurabh singh
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

[algogeeks] Doubt regarding Pointers in C......

2011-01-27 Thread nishaanth
Hi guys, I have a small doubt regarding pointers and functions. Consider the following prototype void insert(bst * head, int data); This function creates a node and inserts the data in the node. Lets say i call this function iteratively from main. main(){ bst* record=NULL; insert(record, 5);

Re: [algogeeks] Doubt regarding Pointers in C......

2011-01-27 Thread rahul
pass a address of pointer. void insert(bst **head, int data); call it using insert(record,8). try this. On Thu, Jan 27, 2011 at 4:47 PM, nishaanth nishaant...@gmail.com wrote: Hi guys, I have a small doubt regarding pointers and functions. Consider the following prototype void

[algogeeks] doubt

2006-06-07 Thread Sriram narasimhan
hi everyone, 1.Can topological sorting be stated as an application of depth first search(DFS)... 2.What is inorder predecessor?how wil i find it??? pls reply Sriram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[algogeeks] doubt boss...

2006-05-26 Thread Sriram narasimhan
hi guys, i wrote a program for arrays and i declared only a[3]. but my array accepts a[5]=10; statements and other statements...how is that possible..arrays are considered as continuous memory of same datatype isnt it...but the array a[3] becomes discontinuous... wat could be the possible