[algogeeks] suggestion

2011-10-03 Thread sukran dhawan
Hello guys, Here is a suggestion.With so much talented people in this group,why cant we a website that is similar to geeksforgeeks. It will be really helpful to others if all the topics are well organised in the form of website This is just a suggestion.just ignore the message if im wrong or u

Re: [algogeeks] Doubly linked list with one pointer

2011-10-02 Thread sukran dhawan
xor linked list http://www.geeksforgeeks.org/archives/12367 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 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote: Design a logic to implement doubly linked list with only

Re: [algogeeks] deep vas shallow

2011-10-01 Thread sukran dhawan
deep copy-value copy so for pointers oly address is copied nt the value so its like two variables pointing to same value shallow copy means pointed to value is copied.so two distinct copies exists On Sat, Oct 1, 2011 at 5:20 PM, rahul sharma rahul23111...@gmail.comwrote: plz xpalin waht is

Re: [algogeeks] deep vas shallow

2011-10-01 Thread sukran dhawan
yup sorry vice versa :) On Sat, Oct 1, 2011 at 6:17 PM, rahul vatsa vatsa.ra...@gmail.com wrote: @sukran, it seems u ve by mistake written deep copy in place of shallow copy vice versa. On Sat, Oct 1, 2011 at 8:31 AM, sukran dhawan sukrandha...@gmail.comwrote: deep copy-value copy so

Re: [algogeeks] Hired by Symantec :) :)

2011-10-01 Thread sukran dhawan
congrats :) wats d package ? On Sat, Oct 1, 2011 at 7:35 PM, sagar pareek sagarpar...@gmail.com wrote: cONGRATES On Sat, Oct 1, 2011 at 7:34 PM, rahul sharma rahul23111...@gmail.comwrote: congrats buddy On Sat, Oct 1, 2011 at 6:51 PM, siva viknesh sivavikne...@gmail.comwrote: I

Re: [algogeeks] stack help

2011-09-30 Thread sukran dhawan
already discussed.search in archives On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma rahul23111...@gmail.comwrote: hw will u design a stack which will have push pop and min fxn...all should operate in o(1) tymreplyn asap -- You received this message because you are subscribed to the

Re: [algogeeks] Linked List Problem

2011-09-29 Thread sukran dhawan
find length of linked list 1 say m find length of linked list2 say n take mod(m-n) say k traverse k nodes in bigger lis after that both listts one position at a time until the pointers are equal On Fri, Sep 30, 2011 at 9:34 AM, partik madan partikma...@gmail.com wrote: @annarao : as the common

Re: [algogeeks] Samsung campus visit

2011-09-28 Thread sukran dhawan
wats the package ? On Tue, Sep 27, 2011 at 9:08 PM, Nitin coolguyinat...@gmail.com wrote: C questions there are 12 -13 questions given on internet it will be same as it is given in the paper ,i dnt find a link right now otherwise do test ur c skills thoruoghly all c questions will be from

Re: [algogeeks] ADOBE

2011-09-28 Thread sukran dhawan
which coll ? On Wed, Sep 28, 2011 at 2:49 PM, DIVIJ WADHAWAN divij...@gmail.com wrote: Adobe is coming to my college in mid October. Can someone tell me what kind of questions do they ask, number and types of rounds etc ?? -- You received this message because you are subscribed to the

Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
int RepChar(char *str) { int i,j; int ret = -1; int count[25]; for (i=0;i25;++i) { count[i]=0; } for (i=0;str[i];++i) { j=str[i] - 'a'; count[j]++; } for (i=0;i25;i++) { if (count[i]==1) { return ('a'+i); } }

Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
); } } return ret; On Wed, Sep 28, 2011 at 8:10 PM, Shravan Kumar shrava...@gmail.com wrote: @Sukran I guess it will return repeating character in alphabetical order but not in order of appearance in the i/p ?? On Wed, Sep 28, 2011 at 8:04 PM, sukran dhawan sukrandha...@gmail.comwrote

Re: [algogeeks] First non-repeated character complexity?

2011-09-28 Thread sukran dhawan
its not d same .check properly :) On Wed, Sep 28, 2011 at 9:56 PM, Avenged nitee...@gmail.com wrote: It's the same code which was posted earlier. Could you explain how to implement using bitset? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Try on linux terminal

2011-09-27 Thread sukran dhawan
nothing is gonna happen... just restart the system after it hangs unless u don put it in init :) On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan suganyapl...@gmail.com wrote: Don't try this... :( :( --Regards, Sug@ny@... -- You received this message because you are subscribed

Re: [algogeeks] Try on linux terminal

2011-09-27 Thread sukran dhawan
yup +1 to shady On Tue, Sep 27, 2011 at 3:44 PM, shady sinv...@gmail.com wrote: at some places there is restriction on the memory that can be utilized... there such actions fail. On Tue, Sep 27, 2011 at 3:40 PM, sukran dhawan sukrandha...@gmail.comwrote: nothing is gonna happen... just

Re: [algogeeks] How to height balance a binary search tree ?

2011-09-27 Thread sukran dhawan
avl tree On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta ankuj2...@gmail.com wrote: Given a bst how to height balance it ? -- 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] Amazon Ques

2011-09-27 Thread sukran dhawan
@rahul if(head == null) return; u cant print head-info when head is null On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma rahul23111...@gmail.comwrote: make sure that u ryt the syntax correct On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma rahul23111...@gmail.comwrote: reverse(head) {

Re: [algogeeks] Amazon Ques

2011-09-27 Thread sukran dhawan
call function recursively when it is the last node, return the function calls and print it On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma rahul23111...@gmail.comwrote: make sure that u ryt the syntax correct On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma rahul23111...@gmail.comwrote:

Re: [algogeeks] Find lowest common ancestor of Binary Tree

2011-09-27 Thread sukran dhawan
it has already been discussed .. search in the archives On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta ankuj2...@gmail.com wrote: Find lowest common ancestor of Binary Tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] Amazon Interview Question

2011-09-26 Thread sukran dhawan
count the number of 0s 1s 2s.then store os first den 1s followed by 2s On Sat, Sep 24, 2011 at 9:55 AM, Anup Ghatage ghat...@gmail.com wrote: Is this like the segregating all the 1's to the right and the 0's to the left or am i missing something? On Sat, Sep 24, 2011 at 9:39 AM, VIHARRI

Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread sukran dhawan
ya pl send On Mon, Sep 26, 2011 at 8:04 PM, rahul sharma rahul23111...@gmail.comwrote: itz same as at scribd.comnot complete..i think itz not easilty availabl 2011/9/26 Vιиodh vinodh...@gmail.com @yogesh : pages are missing in the book u ve mailed man... ly few

Re: [algogeeks] output expalnation?

2011-09-26 Thread sukran dhawan
compile time error... except case labels nothing else will be executed in case of switch statements... so definition of b will not be executed.so compilation error On Tue, Sep 27, 2011 at 6:28 AM, Ratan success.rata...@gmail.com wrote: #includestdio.h int main() { int a=1;

Re: [algogeeks] Re: puzzle

2011-09-24 Thread sukran dhawan
GP 2011/9/24 яαωαт Jee anuragrawat1...@gmail.com ^^ ans will be n*30 mins On Sep 24, 8:40 am, яαωαт Jee anuragrawat1...@gmail.com wrote: sum of GP.. a=1 common ratio=4 sum is given=5.6 billion.. find n simple enough -- You received this message because you are subscribed to the

Re: [algogeeks] Doubts about realloc

2011-09-23 Thread sukran dhawan
yes realloc can be used to shrink the allocated memory. yes the remaining memory will be freed. IF we want to allocate more memory and if there is no enough room in that particular boundary, i will allocate a new block ,copy the contents and free the previous contents On Thu, Sep 22, 2011 at

Re: [algogeeks] What is the maximum no. of arguments that can be given in a command line in C...??

2011-09-23 Thread sukran dhawan
infinite i think not two... u can give many On Fri, Sep 23, 2011 at 8:01 PM, amrit harry dabbcomput...@gmail.comwrote: R U SUREI DONT THINK SOO...? HAD U CHKED IT...? On Fri, Sep 23, 2011 at 7:58 PM, rahul sharma rahul23111...@gmail.comwrote: two On Fri, Sep 23, 2011 at 7:25 PM,

Re: [algogeeks] plz reply quickly

2011-09-23 Thread sukran dhawan
... in linked list hair tortoise rule...initialize two pointers...one's step size:1, second's step size two... run through the linked list, if they meet newhere ...it contains a loop or circular list. On Thu, Sep 22, 2011 at 10:51 PM, sukran dhawan sukrandha...@gmail.comwrote: use hair and tortoise

Re: [algogeeks] plz reply quickly

2011-09-23 Thread sukran dhawan
through the linked list, if they meet newhere ...it contains a loop or circular list. On Thu, Sep 22, 2011 at 10:51 PM, sukran dhawan sukrandha...@gmail.comwrote: use hair and tortoise rule for lists i don think we can do it for arrays On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal

Re: [algogeeks] Try on linux terminal

2011-09-23 Thread sukran dhawan
can u explain it ? On Fri, Sep 23, 2011 at 10:54 PM, Anil Arya anilarya...@gmail.com wrote: :(){ :|: };: -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google

Re: [algogeeks] Try on linux terminal

2011-09-23 Thread sukran dhawan
://in.linkedin.com/pub/amol-sharma/21/79b/507http://youtube.com/amolsharma99 On Fri, Sep 23, 2011 at 11:15 PM, sukran dhawan sukrandha...@gmail.comwrote: can u explain it ? On Fri, Sep 23, 2011 at 10:54 PM, Anil Arya anilarya...@gmail.comwrote: :(){ :|: };: -- *Anil Arya

Re: [algogeeks] easy c output....

2011-09-22 Thread sukran dhawan
awesome :) On Thu, Sep 22, 2011 at 7:55 PM, amrit harry dabbcomput...@gmail.comwrote: @balaji +1 :) On Thu, Sep 22, 2011 at 2:01 PM, Anil Arya anilarya...@gmail.com wrote: thanx Balaji:) On Thu, Sep 22, 2011 at 6:07 AM, Balaji balaji.subraman...@gmail.comwrote: Hi Anil, #a is a

Re: [algogeeks] plz reply quickly

2011-09-22 Thread sukran dhawan
queue represnted as array or linked list ? On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: How will u detect if a queue is circular or not?? -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14

Re: [algogeeks] plz reply quickly

2011-09-22 Thread sukran dhawan
use hair and tortoise rule for lists i don think we can do it for arrays On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: In both the cases... what would be the condition? On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan sukrandha...@gmail.comwrote

Re: [algogeeks] Re: THANX ALGOGEEKS !!!!!!

2011-09-22 Thread sukran dhawan
congrats On Thu, Sep 22, 2011 at 10:33 PM, Prakash D cegprak...@gmail.com wrote: congrats brother!! On Thu, Sep 22, 2011 at 6:42 PM, saurabh sah.saurab...@gmail.com wrote: thanx to all I have shared my interview experience at http://msidcinterview.blogspot.com/ ta -- You received

Re: [algogeeks] Segmentation fault with vfork

2011-09-21 Thread sukran dhawan
@sreeu :lol #includestdio.h? :P include this header file:P That s not saurabh s question On Wed, Sep 21, 2011 at 4:51 PM, SREENU NAIK srinivasulunai...@gmail.comwrote: hi it gives that in fun1:incompatible implicit declaration of built-in function ‘printf’ in fun2:incompatible implicit

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
IT is not the case ... I already said acc to ANSI c result is undefined !! not 0 by dault On Wed, Sep 21, 2011 at 6:50 PM, kartik sachan kartik.sac...@gmail.comwrote: ans in both cases is zero i think if return is written and nthg specified value is given it will return by default

Re: [algogeeks] tree to list

2011-09-21 Thread sukran dhawan
do BFS search,at each level make a linked list On Wed, Sep 21, 2011 at 6:50 PM, prasanth n nprasnt...@gmail.com wrote: anyone give an algorithm of how to convert a binary search tree into a linkedlist -- *prasanth* -- You received this message because you are subscribed to the Google

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
hmmm it is compiler dependent... try out with different compilers... but even though dey give same results,standard c left this eature as undefined for efficiency purposes On Wed, Sep 21, 2011 at 7:16 PM, kartik sachan kartik.sac...@gmail.comwrote: @sukran if it is undefined in ansi c so it

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
its right to left On Wed, Sep 21, 2011 at 7:41 PM, kartik sachan kartik.sac...@gmail.comwrote: thanks sukran... i have one more question evaluation of printf is also undefined in C?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] google maps

2011-09-20 Thread sukran dhawan
How do you implement google maps ? -- 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

Re: [algogeeks] Re: What is the time to get min element from the binary max heap !!

2011-09-20 Thread sukran dhawan
o(n) On Tue, Sep 20, 2011 at 6:42 PM, CHERUVU JAANU REDDY jaanu.cher...@gmail.com wrote: We can find minimum element in O(n) time. Just compare leaf nodes in max heap tree. Cheers Janardhan Reddy Cheruvu +91-9642421117 On Tue, Sep 20, 2011 at 6:39 PM, saurabh agrawal

Re: [algogeeks] Re: stack

2011-09-20 Thread sukran dhawan
void towersofhanoi(char source,char dest,char auxiliary,int n) { if(n == 0) return; else towersoffhanoi(source,auxiliary,dest,n-1); printf(%c to %c \n,source,dest); towersohanoi(auxiliary,dest,source.n-1); } On Tue, Sep 20, 2011 at 11:07 PM, prasanth n nprasnt...@gmail.com wrote: @don:

Re: [algogeeks] c output

2011-09-19 Thread sukran dhawan
common guys its undefined acc to standard c On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee thefourrup...@gmail.com wrote: on running,every time i get second a=30... any reasons for that??? -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: c output

2011-09-19 Thread sukran dhawan
same ans then there has to be some reason, On Sep 19, 12:45 pm, sukran dhawan sukrandha...@gmail.com wrote: common guys its undefined acc to standard c On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee thefourrup...@gmail.com wrote: on running,every time i

Re: [algogeeks] All valid dictionary words must be found and printed.

2011-09-19 Thread sukran dhawan
trie data structure On Mon, Sep 19, 2011 at 10:37 PM, praveen raj praveen0...@gmail.com wrote: Use trie. On 19-Sep-2011 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote: given an array of characters without spaces and a dictionary.All valid dictionary words must be found and printed. i/p

Re: [algogeeks] c output

2011-09-18 Thread sukran dhawan
result is not defined by standard c. It doesnt produce compiler error just because return type is int and no value is returned in if(10) basically garbage On Sun, Sep 18, 2011 at 12:23 PM, Bhavesh agrawal agr.bhav...@gmail.comwrote: #includestdio.h main() { int a ; a=abc();

Re: [algogeeks] c output

2011-09-18 Thread sukran dhawan
again undefined in standard c :) On Sun, Sep 18, 2011 at 1:49 PM, Bhavesh agrawal agr.bhav...@gmail.comwrote: another que.. #includestdio.h main() { int a; int i=10; printf(%d %d %d\n,i+++i,i,i---i); printf(%d\n,i---i); a=i---i; printf(%d \n%d,a,i);

Re: [algogeeks] complement

2011-09-18 Thread sukran dhawan
2's complement On Mon, Sep 19, 2011 at 3:56 AM, Arun Vishwanathan aaron.nar...@gmail.comwrote: Hi all, When I take negation of an integer in C, 0 is displayed as -1 ~5 is displayed as -6. Can some one tell me the logic of how this conversion is happening in C? Arun -- You received this

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

2011-09-17 Thread sukran dhawan
x== 9 is not an error !!! it simply returns a non zero value if its true and 0 if its false On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.com wrote: This will show syntax error due to x==9 and otherwise since memory address given at the declarAtion there fore x value will.

Re: [algogeeks] matrix

2011-09-17 Thread sukran dhawan
kadane s algo On Sat, Sep 17, 2011 at 3:25 PM, prasanth n nprasnt...@gmail.com wrote: given a matrix with +ve and -ve numbers, find the submatrix with maximum sum?? -- *prasanth* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] C Problem

2011-09-17 Thread sukran dhawan
4 and 5. size of will check its first operand. so no evaluation takes place... On Sat, Sep 17, 2011 at 2:32 PM, abhinav gupta abhinav@gmail.comwrote: Ans will be:4,5 On Sat, Sep 17, 2011 at 2:23 PM, Sanjay Rajpal srn...@gmail.com wrote: #includestdio.h int main() { int a=5;

Re: [algogeeks] find the error

2011-09-17 Thread sukran dhawan
get() function ? On Thu, Sep 15, 2011 at 12:14 AM, rahul vatsa vatsa.ra...@gmail.com wrote: ther is no get() function. On Wed, Sep 14, 2011 at 1:55 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: I think there is no problem with the while statement, even if file is not present , it will

Re: [algogeeks] URGENTTTTTTTTT suggestion REGARDING placement...............

2011-09-17 Thread sukran dhawan
Dont attend deloite On Sat, Sep 17, 2011 at 8:25 PM, vivek goel vivek.thapar2...@gmail.comwrote: HELLO FRIENDS,,, PLEASE give me advice THAT if there is a student of *computer branch(B.E. or MCA) and suppose most probably he may be able to get job in Deloitte during campus

Re: [algogeeks] Symantec

2011-09-16 Thread sukran dhawan
which college ? and package ? On Fri, Sep 16, 2011 at 7:39 PM, siva viknesh sivavikne...@gmail.comwrote: Hi Symantec is comin to our collanyone if attended plz share written pattern and interview ques...thanks -- You received this message because you are subscribed to the

Re: [algogeeks] Re: no of elements of the array

2011-09-16 Thread sukran dhawan
not possible On Fri, Sep 16, 2011 at 12:17 PM, tech coder techcoderonw...@gmail.comwrote: +1 to don On Thu, Sep 15, 2011 at 9:40 PM, Don dondod...@gmail.com wrote: Not really. Usually you would need a second parameter indicating the size of the input. In theory it might be possible to put

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

2011-09-16 Thread sukran dhawan
Printing a floating point with %d conversion specifier will not print the expected resultss ! On Sat, Sep 17, 2011 at 1:13 AM, Anshul AGARWAL anshul.agarwa...@gmail.comwrote: #includestdio.h int main() {float t; long x; t=98; printf(%d\n,t); printf(%f\n,x); {

Re: [algogeeks] plzzzzzzzz heeeppppp!!!!!!!!!!1

2011-09-15 Thread sukran dhawan
Just opt fot testing ... If there is a slot for development in the company they will look for the guys in testing first b4 actually going for outside ppl And u can easily shift from testing to development if u perform well On Thu, Sep 15, 2011 at 10:57 AM, rahul sharma

Re: [algogeeks] Interview Questions

2011-09-15 Thread sukran dhawan
run time error because pointer is not assigned a address and it will be pointing to some junk location so *x = 1000 will result in a run time error On Thu, Sep 15, 2011 at 11:32 PM, SAMMM somnath.nit...@gmail.com wrote: #includecstdio #includeiostream using namespace std; int main() {

Re: [algogeeks] Matrix

2011-09-14 Thread sukran dhawan
wat do u mean by reversing a matrix ? On Wed, Sep 14, 2011 at 4:51 PM, bharatkumar bagana bagana.bharatku...@gmail.com wrote: will u pls provide one example .. so that every one understand ... On Wed, Sep 14, 2011 at 1:29 PM, guna sekaran vgun...@gmail.com wrote: Write a program for

Re: [algogeeks] program

2011-09-14 Thread sukran dhawan
heap construction ... On Wed, Sep 14, 2011 at 4:44 PM, bharatkumar bagana bagana.bharatku...@gmail.com wrote: with space O(n) and time O(n), we can trace the whole array and maintain the freq of each number and by one more trace with using 3 variables , we can find top 3 On

Re: [algogeeks] Re: unique no. problem

2011-09-13 Thread sukran dhawan
good one On Tue, Sep 13, 2011 at 2:37 PM, kARTHIK R k4rth...@gmail.com wrote: Nice one sagar. Karthik R, RD Engineer, Tejas Networks. On Tue, Sep 13, 2011 at 2:36 PM, sagar sindwani sindwani.sa...@gmail.comwrote:

Re: [algogeeks] Book for C++

2011-09-12 Thread sukran dhawan
Bjarne stroustroup On Mon, Sep 12, 2011 at 1:43 PM, Ankuj Gupta ankuj2...@gmail.com wrote: Hi Which is a good book for C++ ( Robert Lafore or Bjarne Stroustrup or Herbert Schildt) ? Ankuj -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] pgm2

2011-09-12 Thread sukran dhawan
find the length of string count the occurenece of each character if the length is odd den all characters shud be repeated even number of times except one character which shud be repeated odd no o f times if its even then all characters shud be repeated even number of times On Tue, Sep 13, 2011

Re: [algogeeks] alternative of stack

2011-09-11 Thread sukran dhawan
linked list On Sun, Sep 11, 2011 at 11:22 AM, Neha Singh neha.ndelhi.1...@gmail.comwrote: Linked List -- 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] Re: Number of nodes at each level in binary tree

2011-09-11 Thread sukran dhawan
bfs On Sun, Sep 11, 2011 at 1:51 PM, vijay goswami vjrockks...@gmail.comwrote: countNodeAtEachLevel(node * T, int a[],int level) { if(T!=NULL){ a[level]+=1; countNodeAtEachLevel(T-left,a,level+1); countNodeAtEachLeve(T-right,a,level+1); }

Re: [algogeeks] Programs

2011-09-11 Thread sukran dhawan
1.use character count to record frequencey of occurences // initialise array to 0 2. for(i=0;str[i];i++) { if(count[str[i]] == 0) // first repeated character break; } On Sun, Sep 11, 2011 at 5:43 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: {Please solve the following questions

Re: [algogeeks] requesting your suggestion

2011-09-11 Thread sukran dhawan
infosys i feel... infosys training is awesome On Sun, Sep 11, 2011 at 8:34 PM, Jasveen Singh jasveen.sing...@gmail.comwrote: guys i have been selected in two companies during campus recruitment 1) INFOSYS 2) L T INFOTECH can you plz give me some idea that which one is better to go for??

Re: [algogeeks] Programs

2011-09-11 Thread sukran dhawan
ya +1 to neha use bitset concept in c++ On Sun, Sep 11, 2011 at 8:24 PM, Neha Singh neha.ndelhi.1...@gmail.comwrote: for ques 1 use bit manipulation its more efficient -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] requesting your suggestion

2011-09-11 Thread sukran dhawan
wat is the package ? On Sun, Sep 11, 2011 at 9:43 PM, *$* gopi.komand...@gmail.com wrote: But the hikes of lt wont be much when compared to that of Infy On Sun, Sep 11, 2011 at 9:20 PM, Jasveen Singh jasveen.sing...@gmail.comwrote: @sukran dhawan thanks sukran but can u tell me about

Re: [algogeeks] Data Structures

2011-09-11 Thread sukran dhawan
pl tell me wat ur doin here... here u ve defined a variable node of type struct n. wat does the statement node *c ??? how can u create an instance of an instance ? On Mon, Sep 12, 2011 at 10:52 AM, teja bala pawanjalsa.t...@gmail.comwrote: struct n { int data; struct n* next}node; node *c,*t;

Re: [algogeeks] need help

2011-09-11 Thread sukran dhawan
+1 to tech coder On Mon, Sep 12, 2011 at 10:50 AM, tech coder techcoderonw...@gmail.comwrote: if somebody has the preparation material and videos provided by Careercup.com. Then please send me. thanks. -- tech codYou received this message because you are subscribed to the Google Groups

Re: [algogeeks] C Puzzle

2011-09-11 Thread sukran dhawan
run time error first int * a is not assigned some address... so it will be pointing to some garbage value second two pointers of different types without a typecast will result in unpredictable results On Mon, Sep 12, 2011 at 10:25 AM, teja bala pawanjalsa.t...@gmail.comwrote: #includestdio.h

Re: [algogeeks] Re: How can we find second largest element in an array... in O(n+logn-2)... give me proof.....

2011-09-10 Thread sukran dhawan
large1 = a[0]; large2 = a[1]; if(large1 large2) swap(large1,large2) while(i n) { if(a[i] large1) { large2 = large1 large1 = a[i] } else if(a[i] large2) large2 = a[i] } // test the case if no of elements is 1 :) On Sat, Sep 10, 2011 at 8:54 PM, Dave dave_and_da...@juno.com

Re: [algogeeks] Write a function to find the least common multiple of integers in an array

2011-09-10 Thread sukran dhawan
find GCD by eucledian method LCM = (a * b )/GCD; On Sat, Sep 10, 2011 at 9:13 PM, Gaurav Menghani gaurav.mengh...@gmail.comwrote: http://tinyurl.com/3hm3gug On Sat, Sep 10, 2011 at 10:46 AM, Neha Singh neha.ndelhi.1...@gmail.com wrote: -- You received this message because you are

Re: [algogeeks] Re: How can we find second largest element in an array... in O(n+logn-2)... give me proof.....

2011-09-10 Thread sukran dhawan
where n is the size of array On Sat, Sep 10, 2011 at 9:16 PM, sukran dhawan sukrandha...@gmail.comwrote: large1 = a[0]; large2 = a[1]; if(large1 large2) swap(large1,large2) while(i n) { if(a[i] large1) { large2 = large1 large1 = a[i] } else if(a[i] large2

Re: [algogeeks] Find th gcd of 2 nos in the most efficient way

2011-09-10 Thread sukran dhawan
while(num2 != 0) { rem = num1 % num2 num1 = num2 num2 = rem } On Sat, Sep 10, 2011 at 8:59 PM, Gaurav Menghani gaurav.mengh...@gmail.comwrote: C'mon http://en.wikipedia.org/wiki/Greatest_common_divisor On Sat, Sep 10, 2011 at 11:24 AM, Neha Singh neha.ndelhi.1...@gmail.com wrote: --

Re: [algogeeks] logical and physical address

2011-09-10 Thread sukran dhawan
page size (logical address space) = 512 = 2 power 9 so 9 bits base address = 10 bits so combining them 10+ 9 = 19 bits On Sat, Sep 10, 2011 at 7:18 PM, rohit kumar rohit3...@gmail.com wrote: please explain ... On Sat, Sep 10, 2011 at 5:10 PM, bharatkumar bagana

Re: [algogeeks] Re: Write a program

2011-09-10 Thread sukran dhawan
yes for integer arrays we need to sort o(nlogn) and den compare in o(n) On Sat, Sep 10, 2011 at 7:12 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: Hi, Actually I am not good at hash tables. can u plzz suggest me some gud link from where I can study hash tables... and also tell me

Re: [algogeeks] tree traversal

2011-09-10 Thread sukran dhawan
level order traversal On Sat, Sep 10, 2011 at 10:48 AM, ravi maggon maggonr...@gmail.com wrote: give some traversal other then pre,in and post order to print all elements of tree? Asked in informatica interview. -- Regards Ravi Maggon Final Year, B.E. CSE Thapar University -- You

Re: [algogeeks] Code it

2011-09-10 Thread sukran dhawan
best way it to invoke the function recursively just like a k-1 ary tree correct me if im wrong On Sat, Sep 10, 2011 at 2:49 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: What would be the efficient way to code this program.?? Given an array of size n, find all the possible sub set

Re: [algogeeks] how to find if sum of some of the elements of an array equals to k

2011-09-10 Thread sukran dhawan
sorting will help i guess On Sat, Sep 10, 2011 at 9:51 PM, avi0889 avinaru...@gmail.com wrote: how to find if sum of some of the elements of an array equals to k -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on

Re: [algogeeks] how to find if sum of some of the elements of an array equals to k

2011-09-10 Thread sukran dhawan
sorting and then adding individual elements and then comparing with k On Sat, Sep 10, 2011 at 9:59 PM, sukran dhawan sukrandha...@gmail.comwrote: sorting will help i guess On Sat, Sep 10, 2011 at 9:51 PM, avi0889 avinaru...@gmail.com wrote: how to find if sum of some of the elements

Re: [algogeeks] Write a program to Convert an ASCII representation of a positive integer to it's numeric value ??

2011-09-10 Thread sukran dhawan
u can use atoi function On Sat, Sep 10, 2011 at 10:26 PM, shady sinv...@gmail.com wrote: #include stdio.h #includestring.h main(){ char *s = 88934\0; int sum=0; int i=0; while(istrlen(s)){ int value = s[i]-'0'; sum =

Re: [algogeeks] answer these interesting questions

2011-09-08 Thread sukran dhawan
1 a 2 c 3 b On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi manibharat...@gmail.comwrote: “Kya-Kya” is an island inhabitants of which always answer any question with two answers , one of which is true and the other is false . 1.You are walking on a road and came to a park . You ask the

[algogeeks] backtracking

2011-09-08 Thread sukran dhawan
guys which is the best site or book to practise backtracking and branch and bound programs ? -- 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: size of

2011-09-07 Thread sukran dhawan
null is a macro defined in stdio.h which is equal to 0 . so sizeof(0) is 4 :) On Wed, Sep 7, 2011 at 2:44 AM, UTKARSH SRIVASTAV usrivastav...@gmail.comwrote: and why sizeof(NULL) is giving 4 any ans? -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- *UTKARSH

Re: [algogeeks]

2011-09-07 Thread sukran dhawan
hey its compiler dependent ... no meaning in discussing such questions as standard c considers it as a undefined behaviour On Wed, Sep 7, 2011 at 1:08 PM, annarao kataru kataruanna...@gmail.comwrote: hai in gcc compiler of fedora 14 int main() { int a=4; printf(%d %d %d

Re: [algogeeks]

2011-09-07 Thread sukran dhawan
sieve of erathothenes algo On Wed, Sep 7, 2011 at 1:36 PM, Yogesh Yadav medu...@gmail.com wrote: prime no has only 2 factors. number itself and 1. On Wed, Sep 7, 2011 at 12:14 PM, aayush jain ajain...@gmail.com wrote: can anybody tell me the code of find the prime no. and after finding

Re: [algogeeks] plz xplain the o/p

2011-09-07 Thread sukran dhawan
you are just changing the pointers . so second ptr will point to third string and third will point to second string On Wed, Sep 7, 2011 at 11:34 AM, Shachindra A C sachindr...@gmail.comwrote: I assume you expect to see the strings interchanged. But you are not changing anything in the memory.

Re: [algogeeks] MS written test

2011-09-07 Thread sukran dhawan
which is the best site where in can find backtracking and branch and bound programs ? On Wed, Sep 7, 2011 at 8:58 PM, gmagog...@gmail.com gmagog...@gmail.comwrote: 0xa == 0x 1010, which stands for all the even bits 0x5 == 0x 0101, which stands for all the odd bits 1 and 1 means shifting odd

Re: [algogeeks] Zynga intern

2011-09-06 Thread sukran dhawan
is zynga coming for intern ? which coll ? On Tue, Sep 6, 2011 at 12:28 PM, Shashank Jain shashan...@gmail.com wrote: me 2 Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Wed, Aug 31, 2011 at 4:05 PM, Akash Mukherjee akash...@gmail.comwrote: +1 On Wed,

Re: [algogeeks] Re: convert a word into a palindrome with minimum addition of letters to it

2011-09-06 Thread sukran dhawan
my soln works without increasing the string length just start with first and last character copy last character with first increment i and decrement j and contibue the procedure continue the same till u get mid element :) On Tue, Sep 6, 2011 at 12:56 PM, Atul Modi atul.a...@gmail.com wrote:

Re: [algogeeks] DE shaw question- urgent

2011-09-06 Thread sukran dhawan
ya dont be upset if some one who is not as good as u get a job and u don get it ... think positively ... think that the company don deserve u and start working on ur weak areas On Tue, Sep 6, 2011 at 2:34 PM, siddharam suresh siddharam@gmail.comwrote: my personal experience. guys don't

Re: [algogeeks] C output????

2011-09-06 Thread sukran dhawan
addresses are compared here i think On Tue, Sep 6, 2011 at 9:04 PM, sivaviknesh s sivavikne...@gmail.comwrote: main() { char *p=persons; clrscr(); if(p==persons) printf(technical %s,p); else printf(true %s,p); return 0; } ..op : technical persons ..plz explain .. how come it works

Re: [algogeeks] c output .. help plz

2011-09-06 Thread sukran dhawan
it wil not truncate the floating point to integer remember... On Tue, Sep 6, 2011 at 9:55 PM, sivaviknesh s sivavikne...@gmail.comwrote: printf(%d,3.14*6.25*6.25); ...ans : 0 ..how and why?? why not type conversion take place?? -- Regards, $iva -- You received this message because you

Re: [algogeeks] c output .. help plz

2011-09-06 Thread sukran dhawan
coz both floating point are stored in ieee format which is different from integers On Tue, Sep 6, 2011 at 10:18 PM, sukran dhawan sukrandha...@gmail.comwrote: it wil not truncate the floating point to integer remember... On Tue, Sep 6, 2011 at 9:55 PM, sivaviknesh s sivavikne

Re: [algogeeks]

2011-09-06 Thread sukran dhawan
function pointer so answer is size of pointer can be 4 or 2 depending on word size On Tue, Sep 6, 2011 at 11:21 PM, siddharam suresh siddharam@gmail.comwrote: *main()* is an address/probably the function pointer, Thank you, Sid. On Tue, Sep 6, 2011 at 11:19 PM, Sanjay Rajpal

Re: [algogeeks] Re: Please provide Code to Find kth Smallest or kth Largest element in unsorted array in liner time ?

2011-09-06 Thread sukran dhawan
+1 to piyush On Tue, Sep 6, 2011 at 11:15 PM, Piyush Grover piyush4u.iit...@gmail.comwrote: this can be done using heap tree data structure. -create a max heap tree of first k elements (for finding kth min) -keep on adding elements in the heap if the root element is greater than the

Re: [algogeeks] urgent C o/p

2011-09-05 Thread sukran dhawan
result is undefined.floating points are represented using IEEE ormat which is not same as ints.so it will truncate fractional part and print result .result is nt defined On Mon, Sep 5, 2011 at 1:41 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: u r printing a floating point number using %d

Re: [algogeeks] Linkedlist problem

2011-09-05 Thread sukran dhawan
it wont work.u can set a sentinel value for the last node and make it dummy.so every time u scan the list u need to compare while(list != null and list-vlue != dummy) On Mon, Sep 5, 2011 at 6:34 PM, $hr! k@nth srithb...@gmail.com wrote: How this will work if the node to be deleted is the last

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

2011-09-05 Thread sukran dhawan
well #define SIZEOF(arr) (sizeof(arr)/sizeof(arr[0])) gives the number of elements ie sizeof whole array /sizeof first element second macro #expr - prints variable name and if value is preceded is 0 it means it s in octal formt.it is printed in decimal format by conversion hope i am clear

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

2011-09-05 Thread sukran dhawan
the answers are poy[i] = 1 pot[i] = 2 pot[i] = 8 pot[i] = 64 On Mon, Sep 5, 2011 at 7:55 PM, sukran dhawan sukrandha...@gmail.comwrote: well #define SIZEOF(arr) (sizeof(arr)/sizeof(arr[0])) gives the number of elements ie sizeof whole array /sizeof first element second macro #expr

  1   2   3   >