Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread rahul sharma
gr8...congrats dude On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B kartmu...@gmail.com wrote: Congratulations:) -- 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] Thanks To aLgOgEeKs

2011-12-02 Thread rahul sharma
plz post how you prepared for MS..like the books or websites you followedwould b of gr8 help. On Fri, Dec 2, 2011 at 9:42 PM, rahul sharma rahul23111...@gmail.comwrote: gr8...congrats dude On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B kartmu...@gmail.comwrote: Congratulations

Re: [algogeeks] Link list Q

2011-12-01 Thread rahul vatsa
detects the loop in singly linked list. On Thu, Dec 1, 2011 at 1:42 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What does the following program do on the singly linked list? p=head; q=head-next; while(p!=null q!null) { if(p==q) { exit(0) } p=p-next;

Re: [algogeeks] One small doubt??

2011-11-27 Thread rahul sharma
plz dnt post these type of questions . On Sun, Nov 27, 2011 at 11:40 AM, kumar raja rajkumar.cs...@gmail.comwrote: So does list can be a linked list or similar data structure , right?? On 27 November 2011 11:17, saurabh singh saurab...@gmail.com wrote: ans 1) Array is a *contigous

Re: [algogeeks] Xor Linked lists

2011-11-24 Thread rahul sharma
address can be xored easily with xor operator... http://www.geeksforgeeks.org/archives/12367 On Thu, Nov 24, 2011 at 7:37 PM, kumar raja rajkumar.cs...@gmail.comwrote: http://en.wikipedia.org/wiki/XOR_linked_list In this link i have seen about Xor linked list ,but my doubt is how will u

Re: [algogeeks] Xor Linked lists

2011-11-24 Thread rahul sharma
go to link i said..n at bottom u can find sum programs that are user responshop it helps On Thu, Nov 24, 2011 at 8:45 PM, kumar raja rajkumar.cs...@gmail.comwrote: @rahul: when i tried the following i got an error int a=3,b=2; printf(%p, (a)^(b)); On 24 November 2011 06:28

[algogeeks] structure padding query

2011-11-24 Thread rahul sharma
struct abc { int g; float f; double gj; }; like in this int takes 4 bytes and we want align in 8 bytes so i wana know that whether the float should put with int as 4 bytes are there to complete 8 or float should be int+4 bytes padding and then store the float.. acc to o/p float is

[algogeeks] function overloading query

2011-11-20 Thread rahul sharma
void fun(char *) void fun(const char *) is this overloading works or these are same type of arguments?? -- 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

Re: [algogeeks] function overloading query

2011-11-20 Thread rahul vatsa
yes, it will work. On Sun, Nov 20, 2011 at 9:12 PM, Akash Coder akash.coder.g...@gmail.comwrote: no it wont work ... const is not a datatype. its a qualifier On Sun, Nov 20, 2011 at 7:49 PM, rahul sharma rahul23111...@gmail.comwrote: void fun(char *) void fun(const char

Re: [algogeeks] Silly question

2011-11-20 Thread rahul sharma
u just solve as many problems as u can...everybody has same knowledge...just solve more and more and u will be gud and dnt look at answer frst try urself ..no matter hw many minute and hours it take.it happens wen we have a sol we jsut read it and dnt solve it by ourselfso solve urself

[algogeeks] regarding start of loop in linked list

2011-11-19 Thread rahul sharma
when a loop is found then slow=fast //pointers; then to find start we move one of any pointer at start and other at same palce and move both @ speed of 1...then where they meet is startr,,, can nyone xplain the logic behind this in simple words that how they meet at startthnx in advance

[algogeeks] deep vs shallow copy

2011-11-17 Thread rahul sharma
plz give me xample of these two .as per from book m not able to get thesw clearly,...i have reda from wiki and got it but cant relate with these...plz differ b/w these two with xample..thnx in advance a shallow copy of an object copies all the member field values.this works well if the

Re: [algogeeks] Weird Behaviour of Fork()

2011-11-10 Thread rahul vatsa
u have a new line in 2nd prog bt not in the st, that makes the difference. when u do fork in 1st code, the algo is nt printed on the terminal, rather it is in the stdout buffer oly, which gets duplicated in the forked pr also. nd wen the prog terminates, whtver is ther in the buffer gets printed

Re: [algogeeks] Weird Behaviour of Fork()

2011-11-10 Thread rahul vatsa
in the end if '\n' is not received. thanks rahul :) On Fri, Nov 11, 2011 at 12:31 PM, rahul vatsa vatsa.ra...@gmail.comwrote: u have a new line in 2nd prog bt not in the st, that makes the difference. when u do fork in 1st code, the algo is nt printed on the terminal, rather it is in the stdout

Re: [algogeeks] Weird Behaviour of Fork()

2011-11-10 Thread rahul vatsa
: oh, so what you want to say is that when '\n' is not there in print command and then it is stored in stdout buffer unless it receives a '\n' and executes only in the end if '\n' is not received. thanks rahul :) On Fri, Nov 11, 2011 at 12:31 PM, rahul vatsa vatsa.ra...@gmail.comwrote: u have

Re: [algogeeks] Does anyone know the written pattern of Amazon??

2011-11-09 Thread rahul sharma
hey in our college this is the procedure for internship...n ppo is ther based on profromance On Tue, Nov 8, 2011 at 10:03 PM, kumar raja rajkumar.cs...@gmail.comwrote: Thanks rahul On 8 November 2011 03:32, rahul sharma rahul23111...@gmail.com wrote: apti + technical + 3 prog (mainly

Re: [algogeeks] Does anyone know the written pattern of Amazon??

2011-11-09 Thread rahul patil
not selected but a nice interview. If u have question please feel free to ask me On Tue, Nov 8, 2011 at 10:03 PM, kumar raja rajkumar.cs...@gmail.comwrote: Thanks rahul On 8 November 2011 03:32, rahul sharma rahul23111...@gmail.com wrote: apti + technical + 3 prog (mainly linked list) On Tue, Nov

Re: [algogeeks] what will be the focus of yahoo in written exam ,what to study for it. please respond ASAP..

2011-11-09 Thread rahul sharma
i also want to knw...somebody who has faced yahoo this year plz post. On Wed, Nov 9, 2011 at 11:50 PM, kumar raja rajkumar.cs...@gmail.comwrote: -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in -- You received this message because you are subscribed to the

Re: [algogeeks] Facebook Online Question India

2011-11-09 Thread rahul sharma
facebook visit DCE???wats package??? On Wed, Nov 9, 2011 at 9:22 PM, Decipher ankurseth...@gmail.com wrote: This question was asked by Facebook during their 2 hour online exam (Only 1 question in 2 hour as per my junior) in DCE. Given a list of words wordlist on 1st line (no of words = 100)

Re: [algogeeks] Does anyone know the written pattern of Amazon??

2011-11-08 Thread rahul sharma
apti + technical + 3 prog (mainly linked list) On Tue, Nov 8, 2011 at 3:09 PM, kumar raja rajkumar.cs...@gmail.com wrote: -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] program to convert roman to integer.........

2011-11-06 Thread rahul sharma
i.p: v o/p 5 i/p ix o/p:9 -- 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,

Re: [algogeeks] c output

2011-10-29 Thread rahul sharma
does y goes to d of %*d and it print 5???i hav a doubt On Fri, Oct 28, 2011 at 9:32 PM, amrit harry dabbcomput...@gmail.comwrote: let this statement int x=100,y=5;printf(%*d,x,y); in this line first x is assign to '*' and it become %100d and it will padd 100 spaces before print. and if we

Re: [algogeeks] Search an element in an Infinite array

2011-10-25 Thread rahul sharma
than computing the powers of any other number. Complexity in any case remains the same. On 24 October 2011 10:29, rahul sharma rahul23111...@gmail.comwrote: +1 ankur On Mon, Oct 24, 2011 at 1:26 AM, Ankur Garg ankurga...@gmail.comwrote: Use Binary Search start = 2^n-1 high =2^n where n

Re: [algogeeks] Search an element in an Infinite array

2011-10-25 Thread rahul sharma
@sharmila...wat r u saying??cant get u? On Tue, Oct 25, 2011 at 4:57 PM, sharmila saru sharmi99p...@gmail.comwrote: Give Idea 2 study for GATE... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Search an element in an Infinite array

2011-10-24 Thread rahul sharma
+1 ankur On Mon, Oct 24, 2011 at 1:26 AM, Ankur Garg ankurga...@gmail.com wrote: Use Binary Search start = 2^n-1 high =2^n where n=0,1 On Mon, Oct 24, 2011 at 12:28 AM, sunny agrawal sunny816.i...@gmail.comwrote: hint 1: try to find 2 indexes i, j such that a[i] = K = a[j] On

Re: [algogeeks] Re: Code it...

2011-10-19 Thread Rahul
http://valgrind.org/ I am not sure but this may help on linux. I have a question that how to determine the number of system calls a program has made ? That too of a particular type Rahul On Wed, Oct 19, 2011 at 11:07 AM, kumar raja rajkumar.cs...@gmail.comwrote: Can someone give me an idea

Re: [algogeeks] Re: Code it...

2011-10-19 Thread Rahul
http://www.dgp.toronto.edu/~ajr/209/notes/memoryos.html Rahul On Wed, Oct 19, 2011 at 2:29 PM, Rahul raikra...@gmail.com wrote: http://valgrind.org/ I am not sure but this may help on linux. I have a question that how to determine the number of system calls a program has made ? That too

Re: [algogeeks] Reconstruct BST from preorder traversal

2011-10-18 Thread rahul patil
://groups.google.com/group/algogeeks?hl=en. -- Regards, Rahul Patil -- 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

Re: [algogeeks] Re: print vertical sums of a binary tree

2011-10-18 Thread rahul patil
from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards, Rahul Patil -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Reconstruct BST from preorder traversal

2011-10-18 Thread rahul patil
. 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 group at http://groups.google.com/group/algogeeks?hl=en. -- Regards, Rahul Patil -- You received this message

Re: [algogeeks] Re: print vertical sums of a binary tree

2011-10-18 Thread rahul patil
On Tue, Oct 18, 2011 at 6:31 PM, rahul patil rahul.deshmukhpa...@gmail.comwrote: Use recursion with the code as follows sum array of sums, with horizontal levels, level 0 is for leftmost element void add(node *root, int *sum, int level) { if(root-left

Re: [algogeeks] Amazon Question - Find Pythagorean triplet in an unsorted array

2011-10-14 Thread rahul patil
a given int array. @ rahul, Hash of z^2 - x^2 for each pair of z,x itself will of the size n*(n-1). I am not sure how it will work in O(n) time then. Thanks, - Ravindra On Fri, Oct 14, 2011 at 12:25 AM, Ankur Garg ankurga...@gmail.com wrote: @rahul...How do u choose z and x for computing z

Re: [algogeeks] Amazon Question - Find Pythagorean triplet in an unsorted array

2011-10-14 Thread rahul patil
suppose sorted array is 1,2,3,5,10,12,13,17,19,25 so if u want to find possible combinations, with 25 as hypotenuse, then only range 10 ... 19 could have answer as 19 + 10 25 On Fri, Oct 14, 2011 at 3:14 PM, Ankur Garg ankurga...@gmail.com wrote: @Rahul Pls elaborate with an example

Re: [algogeeks] Re: Adobe

2011-10-14 Thread rahul sharma
i dnt knw why still these posts are allowed in algogeeks On Fri, Oct 14, 2011 at 7:37 PM, WgpShashank shashank7andr...@gmail.comwrote: @All Join Interview-Street Group For Detailed Discussion About Interview Process of Particular Company , if You Have particular question wants to discuss

[algogeeks] Amazon Question - Find Pythagorean triplet in an unsorted array

2011-10-13 Thread rahul
You can create a hash with sqrt(z2-x2). This will make it o(n). The interviewer just made it lil tricky. That's all -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] remove duplicate words from a string

2011-10-11 Thread rahul sharma
if the string is sorted then int rmvDup(char arr[],int arrLen) { int i,j; for (i =1,j=0; i arrLen;i++) { if (arr[j] != arr[i]) { arr[j+1] = arr[i]; j = j+1; } } arr[j]='\0'; return j+1; } On Tue, Oct 11, 2011 at 9:18

Re: [algogeeks] Re: amazon,microsoft link list probs

2011-10-10 Thread rahul patil
://groups.google.com/group/algogeeks?hl=en. -- Regards, Rahul Patil -- 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

Re: [algogeeks] Fwd: why we can not swap values using macro?

2011-10-10 Thread rahul sharma
macros i thnik cant swap pointers..i have doubt for same it is test ur c skil question On Sun, Oct 9, 2011 at 10:08 PM, sunny agrawal sunny816.i...@gmail.comwrote: because you have not made any call to swap values of x and y I Don't know what you are trying to do here if you want to swap

Re: [algogeeks] Re: MS test cases type Questions

2011-10-09 Thread rahul sharma
there r lot of stuff for this in algogeeks.plz u all r requested to post these kind of quries on interview-street..i can tell u this last tym... for testing profyl questions will be : 1.u open word fyl and do wrk and save...what can be test cases that error can pccur. 2. u taking to frnd

[algogeeks] Database Classes

2011-10-08 Thread Rahul Verma
Hi friends, Sorry for this off topic, but I found that it would be interesting for us that now we have online classes of Databases from Stannford.db-class.org -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the

[algogeeks] SUGGESTIOn TO ALGo GEEKS

2011-10-08 Thread rahul sharma
I have a suggestion to made...as a new group interview-street is there..but still a lot more info is available here in algogeeks only..so cant the owner of group move all the info about all the companies from algogeeks to interview-street.like pattern n ctc n etc..so that if somebody try to find

Re: [algogeeks] SUGGESTIOn TO ALGo GEEKS

2011-10-08 Thread rahul sharma
iterview street...hope it helps... On Sat, Oct 8, 2011 at 11:06 PM, shady sinv...@gmail.com wrote: ya, how to do it ? how to move all discussions from one group to another if you know the procedure then reply. :D On Sat, Oct 8, 2011 at 10:41 PM, rahul sharma rahul23111...@gmail.comwrote

Re: [algogeeks] Database Classes

2011-10-08 Thread Rahul Verma
You are welcome. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/WJz0FGP5wUgJ. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] print all numbers in a given range without using any loop statements, jump statements and recursion

2011-10-07 Thread rahul sharma
it will work without having --i in destructor???y is it here? On Fri, Oct 7, 2011 at 11:44 AM, tanuj chawla houndhun...@gmail.com wrote: #includeiostream int i; class A { public: A(){couti++endl;} ~A(){cout--iendl;} } int main() { A a[100]; return 0; } On Thu, Oct 6, 2011 at

Re: [algogeeks] print all numbers in a given range without using any loop statements, jump statements and recursion

2011-10-07 Thread rahul sharma
yeah fyn On Fri, Oct 7, 2011 at 1:18 PM, tanuj chawla houndhun...@gmail.com wrote: @rahul - ya sure. i write the code for printing 1 to 100 and vice versa.. u can remove --i in the destructor.. sorry... -- You received this message because you are subscribed to the Google

[algogeeks] Re: implementation of malloc

2011-10-07 Thread Rahul Tiwari
http://www.sendspace.com/file/wxqx5l On Oct 7, 10:09 am, saurabh singh saurab...@gmail.com wrote: It uses the system call brk On Fri, Oct 7, 2011 at 10:23 AM, praneethn praneeth...@gmail.com wrote: can somebody provide the link or explain how malloc is implemented internally as

[algogeeks] Re: explain the output please.....

2011-10-07 Thread Rahul Tiwari
o/p - fail1 pass2 xplaination - as char range = (-127 to +127) so char c=-64 is ok so (ci) condition z not true ..so else part got executed . but u is unsigned so its actual value z , u = some very high + no. so iu cond is true -- so the final o/p --- fail1 pass2 if u want to

Re: [algogeeks] Re: Operating System

2011-10-07 Thread Rahul
CROWLEY +1 Rahul On Sat, Oct 8, 2011 at 2:26 AM, saurabh araiyer siz...@gmail.com wrote: OS by Crowly (design oriented approach) is a nice book -- Regards Saurabh Araiyer http://www.decapsulatingabstraction.blogspot.com -- You received this message because you are subscribed

Re: [algogeeks] Re: explain the output please.....

2011-10-07 Thread rahul sharma
o/p : fail 1 between c and u they will be in range so stored as it is but i is -16 converted to 2 complement n become -32 thats y On Sat, Oct 8, 2011 at 2:02 AM, Rahul Tiwari rahultiwari6...@gmail.comwrote: o/p - fail1 pass2 xplaination - as char range = (-127 to +127) so char c=-64

Re: [algogeeks] suggestion

2011-10-05 Thread rahul sharma
dnt agreee..everyone should get chance...the admin should post that wat to post n wat not not toif again someone post abou the companies n ctc etc.. he should be warn...else on second chance he should be droped from the group On Wed, Oct 5, 2011 at 11:03 AM, saurabh singh

[algogeeks] nagle's algorithm

2011-10-05 Thread Rahul Tiwari
plz suggest any good link that covers the complete basics abt nagle's algo ... -- 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] Re: Qualcomm

2011-10-05 Thread Rahul Tiwari
@prag .. dude those 2 guys r not frm cs-it 1 more thine udit is also from our college (MNNIT Allahabad ) .. udit hi vo banda hai jiska technical sabse achha gaya tha qualcomm me but after 1 hour good tech round, w/o any reason QUALCOMM rejects udit .. udit z jst xpressing his

[algogeeks] Re: best way to learn data structure

2011-10-04 Thread Rahul Verma
Hey Raghav, No methods are worst or best. Just go through any book you have and try the atleast 5 or 6 problems of various difficulty level based on that data structure. Try to think about the functionality of the data structure, so that you can implement it in various situations or use it

Re: [algogeeks] Re: best way to learn data structure

2011-10-04 Thread Rahul
http://www.stanford.edu/class/cs106x/ http://see.stanford.edu/see/courseinfo.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e Awesome You need to have Visual Studio 2005 On Tue, Oct 4, 2011 at 10:14 PM, shady sinv...@gmail.com wrote: there is nothing like best book... which covers all

Re: [algogeeks] Re: MS question

2011-10-03 Thread rahul sharma
yeah it is wrong..i have a solution but uses 0(n+m) space.i need it in 0(n*m) tymand o(1) space On Mon, Oct 3, 2011 at 11:55 AM, shady sinv...@gmail.com wrote: search archives :-/ On Mon, Oct 3, 2011 at 11:47 AM, pranav agrawal pranav.is.cool.agra...@gmail.com wrote: @rahul

Re: [algogeeks] Re: string compress/expand

2011-10-03 Thread Rahul Verma
@rahul sharma for that you have to check that string is alphanumeric or not. if it is alphanumeric then you have to call the function exapansion else you have to call the compression function. and if the desired output for *abc *is *a1b1c1* then you have to call the *exapnsion function

Re: [algogeeks] Re: string compress/expand

2011-10-03 Thread rahul sharma
(); } On Mon, Oct 3, 2011 at 12:08 PM, Rahul Verma rahulverma@gmail.comwrote: @rahul sharma for that you have to check that string is alphanumeric or not. if it is alphanumeric then you have to call the function exapansion else you have to call the compression function. and if the desired

[algogeeks] Re: zigzag matrix

2011-10-03 Thread Rahul Verma
@Anika What do you mean with the zigzag fashion here in problem? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/5rO1BmBFlZwJ. To post to this group, send

[algogeeks] InterNSHIP for PRE final YEAR....................Hydrabaad MS

2011-10-03 Thread rahul sharma
http://www.microsoft-careers.com/job/Hyderabad-Intern-Job/1439341/?feedId=315utm_source=Indeed -- 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,

[algogeeks] c help

2011-10-03 Thread rahul sharma
% p prints the corresponding argument that is pointer.can nyone given an xample plz? -- 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

Re: [algogeeks] Re: zigzag matrix

2011-10-03 Thread Rahul Verma
we can achieve the zigzag form of the matrix by performing below steps: int i=1,j=1; For(i=0;im+n-1;i++) { If(in) then j increases upto the value of i Elseif (i=n i=m) j increases upto value of m Elseif(im) j increases upto value of n+m-i. } *For e.g* *for a 4X6 matrix*

Re: [algogeeks] Re: zigzag matrix

2011-10-03 Thread Rahul Verma
@Hatta Thanks a lot dear. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/jCx1kM6n4RwJ. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] New Group For Practicing and Learning Efficient Ways of Coding

2011-10-03 Thread Rahul Verma
@shady we need moderators to stop spamming and to restrict the no. of problems -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/gArbDhccZG8J. To post to this

Re: [algogeeks] Re: Urgent sol needed

2011-10-03 Thread rahul sharma
; } } } Thus there is no extra space taken. Shruti On Oct 3, 12:27 am, rahul sharma rahul23111...@gmail.com wrote: nput is a matrix of size n x m of 0s and 1s. eg: 1 0 0 1 0 0 1 0 0 0 0 0 If a location has 1; make all the elements

[algogeeks] Re: oracle finance questions

2011-10-03 Thread Rahul Tiwari
colg ? pkg ??? On Oct 3, 7:36 pm, amit kannaujiya amitkannaujiyan...@gmail.com wrote: if any one know  regarding oracle finance online test, plz post type of questions asked in online test . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

Re: [algogeeks] Re: string compress/expand

2011-10-03 Thread rahul sharma
; index = index+2; } } s[index-1]='\0'*;//terminate the string* *(a3b4bb will become a3b4)* } On Mon, Oct 3, 2011 at 12:12 PM, rahul sharma rahul23111...@gmail.comwrote: check my code for compression.. check if it is ok abc i/p o/p abc means if character has no count.but

Re: [algogeeks] Re: MS question

2011-10-03 Thread rahul sharma
Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Oct 3, 2011 at 12:08 PM, rahul sharma rahul23111...@gmail.comwrote: yeah it is wrong..i have a solution but uses 0(n+m) space.i need it in 0(n*m) tymand o(1) space On Mon, Oct 3, 2011

Re: [algogeeks] Re: MS question

2011-10-03 Thread rahul sharma
final output is 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Oct 4, 2011 at 7:49 AM, rahul sharma rahul23111...@gmail.comwrote: @ashish can u give an xample.plz...i have read a lot archives

Re: [algogeeks] Re: MS question

2011-10-03 Thread rahul sharma
+919985813081 +919966006652 On Tue, Oct 4, 2011 at 8:28 AM, rahul sharma rahul23111...@gmail.comwrote: row0 and col0 initilayy true coz we have 0 in 0 row???or these r default values? On Tue, Oct 4, 2011 at 8:07 AM, Ashish Goel ashg...@gmail.com wrote: 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 row0

Re: [algogeeks] Re: MS question

2011-10-03 Thread rahul sharma
got it..thnx yr On Tue, Oct 4, 2011 at 8:34 AM, rahul sharma rahul23111...@gmail.comwrote: so we shoul d aslo add loop at the top to find only for firrst row and column the initial values On Tue, Oct 4, 2011 at 8:30 AM, Ashish Goel ashg...@gmail.com wrote: 0 in 0th row as well as 0 in 0th

Re: [algogeeks] New Group For Practicing and Learning Efficient Ways of Coding

2011-10-03 Thread Rahul Verma
Hey, I have a suggestion that why we don't have a discussion on some topic for full one week and after that we can discuss problems from various programming sites and discuss the best solution of the problems.. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: deep vas shallow

2011-10-02 Thread rahul sharma
, Oct 1, 2011 at 7:36 PM, rahul sharma rahul23111...@gmail.comwrote: plz give any c++ xample to xplain bit more On Sat, Oct 1, 2011 at 6:59 PM, Bejoy kalikotay(sikkimesechora) bijaykaliko...@gmail.com wrote: A shallow copy of an object copies all of the member field values. This works

Re: [algogeeks] Re: deep vas shallow

2011-10-02 Thread rahul vatsa
shallow copy - class MyString { char *str; public: MyString(char *); //MyString operator=(const MyString t); }; MyString :: MyString(char *) { } MyString a(rahul); MyString b; b = a; the default = operator does a bitwise copy, so if we don't overload the default behaviour

Re: [algogeeks] Re: deep vas shallow

2011-10-02 Thread rahul vatsa
] ; strcpy(str, s); } MyString a(rahul); MyString b; b = a; the default = operator does a bitwise copy, so if we don't overload the default behaviour, it will just copy the contents of a to b. so now both a b will point to the same memory. this is shallow copy. nd it hs memory issues

[algogeeks] Re: linux program in c

2011-10-02 Thread rahul sharma
plz tell me hw does fork wokrs???child contain full code ore the statements after forkhw pid is 0 with pi=fork(); i cant get these..plz tell asap...thnx On Oct 2, 12:49 pm, rahul sharma rahul23111...@gmail.com wrote: main() { int pid; pid=fork(); if(pid==0) { print child; print

[algogeeks] linux program in c

2011-10-02 Thread rahul sharma
main() { int pid; pid=fork(); if(pid==0) { print child; print(...,getpid()); } else { print print; print(...,getpid()); } -- 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] Re: linux program in c

2011-10-02 Thread rahul vatsa
child contains full code, bt it will start execution of the next line after the fork. return value of fork is 0 for the child, bt pid of the child in the parent process. On Sun, Oct 2, 2011 at 3:50 AM, rahul sharma rahul23111...@gmail.comwrote: plz tell me hw does fork wokrs???child contain

[algogeeks] Re: Needed recursive sol

2011-10-02 Thread Rahul Tiwari
;i++) { printf(%d\t,fib(i)); sum+=fib(i); } printf(\nsum upto %d terms = %d\n,n,sum); return 0; } rahul -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Re: linux program in c

2011-10-02 Thread rahul sharma
pid=0 for child then getpid in child???gives child process id???plz xplain On Sun, Oct 2, 2011 at 1:32 PM, rahul vatsa vatsa.ra...@gmail.com wrote: child contains full code, bt it will start execution of the next line after the fork. return value of fork is 0 for the child, bt pid

Re: [algogeeks] Re: Needed recursive sol

2011-10-02 Thread rahul sharma
@rahul tiwari..i have that soln...i think u cnt get questionhw do we knw the number of terms?/ On Sun, Oct 2, 2011 at 2:09 PM, Rahul Tiwari rahultiwari6...@gmail.comwrote: working code : #includestdio.h int fib(int n) { if(n==1) return 0; if(n==2) return 1

Re: [algogeeks] Re: linux program in c

2011-10-02 Thread rahul vatsa
pr. is it clear .. On Sun, Oct 2, 2011 at 5:01 AM, rahul sharma rahul23111...@gmail.comwrote: pid=0 for child then getpid in child???gives child process id???plz xplain On Sun, Oct 2, 2011 at 1:32 PM, rahul vatsa vatsa.ra...@gmail.com wrote: child contains full code, bt it will start

Re: [algogeeks] Re: adobe question help

2011-10-02 Thread rahul sharma
yeah u r ryt. On Sun, Oct 2, 2011 at 4:20 PM, ravi ojha rbojha...@gmail.com wrote: in the first loop the value of k shuld vary from 0 to j-i. On Oct 1, 7:26 am, rahul sharma rahul23111...@gmail.com wrote: You are given two 32-bit numbers, N and M, and two bit positions, i and j

Re: [algogeeks] Re: adobe question help

2011-10-02 Thread rahul sharma
can u tell in this we have to set i and j also or only between elements say if i=2 and j=6 then whether we should set bit no 2,3,4,5,6, or 3,4,5 acc. to me its 2,3,4,5,6, and ur logic also give that answer plz tell?? On Sun, Oct 2, 2011 at 4:38 PM, rahul sharma rahul23111

[algogeeks] remove duplicates from array

2011-10-02 Thread rahul sharma
1. remove duplicates from array when it is sorted..o(n)tym and o(1) space.. 2. remove duplicates from array when it is not sorted..o(n)tym and o(1) space.. i can tget these from archives...if anybody earlier asked then plz post me the link of thtaif not then rovide me with sol of

[algogeeks] Re: remove duplicates from array

2011-10-02 Thread rahul sharma
that the input is sorted. O(n) time complexity without any additional space 2. this is soli got from sumwhere...hope it help sumone...may b u peaople cum with new for unsorted...sort in nlogn..then remove in n On Sun, Oct 2, 2011 at 9:48 PM, rahul sharma rahul23111...@gmail.comwrote: 1

Re: [algogeeks] MS WRITTEN TEST FOR INTERNS

2011-10-02 Thread rahul sharma
hey from which college r u??? On Sun, Oct 2, 2011 at 10:51 PM, gaurav kumar mailmea...@gmail.com wrote: there were 10 objective questions covering c,c++ and ds questions were on mainly memory allocation stack and heap ,etc output/error ; subjective part 1. compress the given string eg.

Re: [algogeeks] linux program in c

2011-10-02 Thread rahul sharma
just given a basic psudocode On Sun, Oct 2, 2011 at 11:11 PM, Hatta tmd...@gmail.com wrote: what is 'print'? there's no such thing in C. On Sun, Oct 2, 2011 at 4:49 AM, rahul sharma rahul23111...@gmail.com wrote: main() { int pid; pid=fork(); if(pid==0) { print child; print

Re: [algogeeks] Re: MS WRITTEN TEST FOR INTERNS

2011-10-02 Thread rahul sharma
u r a 3rd year studentfor placement test is different??? On Sun, Oct 2, 2011 at 11:19 PM, gaurav kumar mailmea...@gmail.com wrote: pec, unversity of technology chandigarh On Oct 2, 10:46 pm, rahul sharma rahul23111...@gmail.com wrote: hey from which college r u

Re: [algogeeks] Doubly linked list with one pointer

2011-10-02 Thread rahul sharma
xor linked list. On Sun, Oct 2, 2011 at 11:32 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote: Design a logic to implement doubly linked list with only one pointer -- Cheers, Vicky -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

Re: [algogeeks] Doubly linked list with one pointer

2011-10-02 Thread rahul sharma
http://www.geeksforgeeks.org/archives/12367 On Sun, Oct 2, 2011 at 11:34 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote: @rahul : can u give any related links plz On Sun, Oct 2, 2011 at 11:33 PM, rahul sharma rahul23111...@gmail.comwrote: xor linked list. On Sun, Oct 2, 2011 at 11:32

Re: [algogeeks] Doubly linked list with one pointer

2011-10-02 Thread rahul sharma
hope u were asking about dat... On Sun, Oct 2, 2011 at 11:36 PM, rahul sharma rahul23111...@gmail.comwrote: http://www.geeksforgeeks.org/archives/12367 On Sun, Oct 2, 2011 at 11:34 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote: @rahul : can u give any related links plz On Sun, Oct 2

[algogeeks] MS question

2011-10-02 Thread rahul sharma
if element is 0 in matrix then entire row and column should be set to 0 i got this from sumwhr void makeRowColZero(int (*a)[COL]) { int i, j, k; k = 0; for(i = 0; i ROW; i++) for(j = k; j COL; j++) { if(0 ==

[algogeeks] Urgent sol needed

2011-10-02 Thread rahul sharma
nput is a matrix of size n x m of 0s and 1s. eg: 1 0 0 1 0 0 1 0 0 0 0 0 If a location has 1; make all the elements of that row and column = 1. eg 1 1 1 1 1 1 1 1 1 0 1 1 Solution should be with Time complexity = O(n*m) and O(1) extra space -- You received this message because you are

Re: [algogeeks] Re: linked list reverse

2011-10-02 Thread rahul sharma
@ Digo ..i got almost wat u said...can u give me a example with 3-4 nodes...it will help me a lot..thnx.. On Mon, Oct 3, 2011 at 1:43 AM, Digo dipitgro...@gmail.com wrote: See you are actually passing the address of 'rest' each time, so the changes made to *head_ref are actually reflected in

Re: [algogeeks] Re: linked list reverse

2011-10-02 Thread rahul sharma
got it...thnx a lot buddy,,, On Mon, Oct 3, 2011 at 7:20 AM, rahul sharma rahul23111...@gmail.comwrote: @ Digo ..i got almost wat u said...can u give me a example with 3-4 nodes...it will help me a lot..thnx.. On Mon, Oct 3, 2011 at 1:43 AM, Digo dipitgro...@gmail.com wrote: See you

[algogeeks] string compress/expand

2011-10-02 Thread rahul sharma
Write a routine that takes input as a string such as aabbccdef and o/p a2b2c2def or a4bd2g4 for bdd if i want to make a general program for this..cani do by checking the 2nd array item if it is a number then i will call a fxn expandelse i will call

[algogeeks] fibonicci doubt

2011-10-02 Thread rahul sharma
guys if i have Print the sum of the even terms occuring in Fibbonaci (till 1000 terms) then i will go for(i=0;i=1000;i++) { fibonicii code add if even } for 1000 fib terms if i have Print the sum of the even terms occuring in Fibbonaci (till 1000) it indicates that we will stop when we

[algogeeks] Re: fibonicci doubt

2011-10-02 Thread rahul sharma
find the sum of all even nos. in the fibbonacci series upto 100 it means upto when my term in fibonici is 100 stop...???ok? On Mon, Oct 3, 2011 at 8:06 AM, rahul sharma rahul23111...@gmail.comwrote: guys if i have Print the sum of the even terms occuring in Fibbonaci (till 1000 terms

[algogeeks] Re: string compress/expand

2011-10-02 Thread Rahul Verma
@Rahul Parse the string and check the next element of the array if it is exactly the previous one then *increase the counter by 1* else no need to increase the counter. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view

Re: [algogeeks] Re: string compress/expand

2011-10-02 Thread rahul sharma
@rahul verma yeah i know supposes i m doing for a3b3c3.. o/p :- aaabbbccc if i give i/p: abc to same program then should it accept n display then errorrcoz abc not accepted...a1b1c1 is aceeptedor it will show abc as such.. tell me wat to do for abc On Mon, Oct 3, 2011

<    1   2   3   4   5   6   7   8   9   >