Re: [algogeeks] Remove minimum set of vertices to make the grap divided into more than one component

2014-05-09 Thread siddharam suresh
use DFS remove 1( and all combination of 2 to n-2 nodes) node aply DFS Thank you, Sid. phone:+91-8971070727, +91-9916809982 On Sun, May 4, 2014 at 10:14 PM, shashi kant shashiski...@gmail.com wrote: @shaswat : dude it's obvious that graph will be divided into more than 1 components

Re: [algogeeks] Palindrome tree

2013-11-07 Thread siddharam suresh
if the given tree is complete B tree then its similar to the mirror tree problem On Fri, Sep 6, 2013 at 3:38 AM, subrat kumar prasad iitr.s...@gmail.comwrote: bool check_palin(vectorchar v){ vectorchar v1(v); reverse(v1.begin(),v1.end()); for(int i = 0;iv.size();i++)

Re: [algogeeks] Re: Check if one tree is sub tree of other

2012-03-22 Thread siddharam suresh
1 3 Inorder traversal is 163. But they second tree is not subset. let me know if i got the question wrong. On Wed, Mar 21, 2012 at 10:27 AM, shady sinv...@gmail.com wrote: @Sid +100 On Wed, Mar 21, 2012 at 10:20 AM, siddharam suresh siddharam@gmail.com

Re: [algogeeks] Explain the code

2012-03-20 Thread siddharam suresh
output is: 12(12 white spaces before 12) Thank you, Sid. phone:+91-8971070727, +91-9916809982 On Tue, Mar 20, 2012 at 5:30 PM, rahul rahulr...@gmail.com wrote: I thought it print 12 because 2 is printed by insider printf ( because of 2 string) and 1 is printed by outsider printf(

Re: [algogeeks] Re: Check if one tree is sub tree of other

2012-03-20 Thread siddharam suresh
get the inorder traversal both tree (into strings) check weather one string substring of other if yes then one tree is sub tree of other. Thank you, Sid. phone:+91-8971070727, +91-9916809982 On Wed, Mar 21, 2012 at 9:23 AM, HARSHIT PAHUJA hpahuja.mn...@gmail.comwrote: bool isSubtree(Tree *

Re: [algogeeks] why java program has main function named public static void main(..) ?

2011-10-03 Thread siddharam suresh
public for visible to compiler/interpreter. static only one main for one class/file/package. void return none to compile/interpreter. Thank you, Sid. On Mon, Oct 3, 2011 at 1:35 PM, Vengadanathan fantastic.n...@gmail.com wrote: Hello everyone , i recently attended a mock interview kept by one

Re: [algogeeks] Linked List Problem

2011-09-29 Thread siddharam suresh
@Ankuj Gupta: your algo wont work see,what happens when ur algo run. list1 1-2-3-4-5-6 list2 9-8-4-5-6 reverse list 1 list1 6-5-4-3-2-1 6-5-4 ^ | list2 8-9 reverse list 2 list1 6-5-4-9-8 list2 4-9-8 Thank you, Sid. On Fri, Sep 30, 2011 at 9:37

Re: [algogeeks] cdoc

2011-09-29 Thread siddharam suresh
i never heard about the company called cdoc it may be cdac or cdot Thank you, Sid. On Thu, Sep 29, 2011 at 7:48 PM, sourabh jain sourabhjain...@gmail.com wrote: cdoc visited anywhere? tell me details? Regards SOURABH KUMAR JAIN NIT RAIPUR -- You received this message because

Re: [algogeeks] C-dot Interview Questions

2011-09-17 Thread siddharam suresh
logic design, Flip flops computer organisation,especially MMU. data structure, os Thank you, Sid. On Fri, Sep 16, 2011 at 10:06 PM, harshit sethi hshoneyma...@gmail.comwrote: somebody reply.. On Fri, Sep 16, 2011 at 8:53 PM, Harshit Sethi hshoneyma...@gmail.comwrote: hi

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

2011-09-15 Thread siddharam suresh
testing is very broad area of s/w development. first get clear about the job, when i was giving interview with MS for SDET, they said its developing test s/w for already build s/w. my view, testing requires more skills than developer, to find out the flaws in the code. Thank you, Sid. On

Re: [algogeeks] C++ Query...

2011-09-15 Thread siddharam suresh
i saw better solution in stack over flow, but these things violates the Memory rules of C++ Thank you, Sid. On Thu, Sep 15, 2011 at 6:41 PM, teja bala pawanjalsa.t...@gmail.comwrote: @ BHARATH exactly very thx On Thu, Sep 15, 2011 at 5:22 PM, bharatkumar bagana

Re: [algogeeks] Re: branching factor when BFS and DFS of a graph is same

2011-09-14 Thread siddharam suresh
for the penultimate node. by penultimate node i mean whose children are the leaves of the tree. rest all cases it should be 1. On Tue, Sep 13, 2011 at 9:24 AM, siddharam suresh siddharam@gmail.com wrote: cant say if there more than one leaf element still both the algo give

Re: [algogeeks] Re: branching factor when BFS and DFS of a graph is same

2011-09-14 Thread siddharam suresh
of a recursive solution to find out similarity or isomorphism. Not sure how this extends for a graph. Always thought a DFS and/or BFS should suffice but apparently not. On Sep 14, 1:43 am, siddharam suresh siddharam@gmail.com wrote: bharath.sriram, perform inorder traversal and peorder/postorder

Re: [algogeeks] branching factor when BFS and DFS of a graph is same

2011-09-12 Thread siddharam suresh
cant say if there more than one leaf element still both the algo give same result Thank you, Sid. On Tue, Sep 13, 2011 at 7:52 AM, Sundi sundi...@gmail.com wrote: if the dfs and bfs of a graph is same, does it mean that if the branching factor of a graph is one? abcd example: both dfs

Re: [algogeeks] sorting

2011-09-09 Thread siddharam suresh
@praveen raj: yes bubble sort takes O(N) in best case, but selection sort it depends the selection algo(does the selection starts from the first(then itsO(n)) or last(then its O(N^2)) Thank you, Sid. On Fri, Sep 9, 2011 at 11:20 AM, praveen raj praveen0...@gmail.com wrote: for checking whther

[algogeeks] difference ?

2011-09-09 Thread siddharam suresh
is there any difference b/w int var; var=0; and int var; var =0; both codes yield the same value right? Thank you, Sid. -- 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

[algogeeks] siddharam suresh wants to chat

2011-09-09 Thread siddharam suresh
--- siddharam suresh wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-c210beca0f-94c347d8f9-1MYpPRw3iV2W4LJT9RRZENB3cAY

Re: [algogeeks] worst case complexity

2011-09-09 Thread siddharam suresh
first loop n send loop n^2 third loop n(i m not sure) so n^4 Thank you, Sid. On Sat, Sep 10, 2011 at 11:09 AM, ravi maggon maggonr...@gmail.com wrote: I think it should be n^3 On Sat, Sep 10, 2011 at 10:51 AM, Neha Singh neha.ndelhi.1...@gmail.comwrote: O(n^5) -- You received this

Re: [algogeeks] plz xplain the o/p

2011-09-07 Thread siddharam suresh
as per my knowledge 1)this is not swapping of the strings, use double indirection (use swap function swap(char **t1, char **t2)) 2)you cant change the address of the any array,(use change it to char *t1=xyz,*t2=abc; ) Thank you, Sid. On Wed, Sep 7, 2011 at 11:26 AM, piyush agarwal

Re: [algogeeks] plz xplain the o/p

2011-09-07 Thread siddharam suresh
my mistake, for 2)you cant change the address of the any array,(use change it to char *t1=xyz,*t2=abc; ) i thought pstr is array of array of strings(but  is array of character pointer), @sachindraac is right char *pstr[2] = {Hello, piyush}; Thank you, Sid. On Wed, Sep 7, 2011 at 11:34 AM,

Re: [algogeeks] plz xplain the o/p

2011-09-07 Thread siddharam suresh
http://www.daniweb.com/software-development/c/threads/339649 Thank you, Sid. On Wed, Sep 7, 2011 at 11:43 AM, siddharam suresh siddharam@gmail.com wrote: my mistake, for 2)you cant change the address of the any array,(use change it to char *t1=xyz,*t2=abc; ) i thought pstr is array

Re: [algogeeks]

2011-09-07 Thread siddharam suresh
guys there is subject called number theory and cryptography, in which there are so many algos to find prime number and prime factors of the number. Thank you, Sid. On Thu, Sep 8, 2011 at 11:17 AM, bharatkumar bagana bagana.bharatku...@gmail.com wrote: @sukran : sieve of erathothenes algo

Re: [algogeeks] DE shaw question- urgent

2011-09-06 Thread siddharam suresh
my personal experience. guys don't regret while placements, it wont bring any work-ability in the preparation. always look for what was missing in the last interview, prepare well. I didnt prepare because of the initial failure in the placements(ended up where i did not planed). I wish that wont

Re: [algogeeks] Algo Book

2011-09-06 Thread siddharam suresh
Data Structures and Algorithms Alfred V. Aho (Author), Jeffrey D. Ullman (Author), John E. Hopcroft (Author) Thank you, Sid. On Tue, Sep 6, 2011 at 3:45 PM, Neha Gupta nehagup...@gmail.com wrote: hey guys , do tell me a book for algo( other than cormen) with good no. of illustrations or any

Re: [algogeeks] Algo Book

2011-09-06 Thread siddharam suresh
@neha: there is site calledhttp://library.nu register there, u'll get majority of the books. Thank you, Sid. On Tue, Sep 6, 2011 at 3:54 PM, Prashant Kulkarni prashant.r.k...@gmail.com wrote: The Algorithm Design Manual By Steve S. Skiena -- Prashant Kulkarni On Tue, Sep 6, 2011 at

Re: [algogeeks]

2011-09-06 Thread siddharam suresh
*main()* is an address/probably the function pointer, Thank you, Sid. On Tue, Sep 6, 2011 at 11:19 PM, Sanjay Rajpal srn...@gmail.com wrote: #include stdio.h #includeconio.h int main() { printf( %d,sizeof(main())); ... getche(); return 0; } o/p is 4..how ??? Sanju :) -- You

Re: [algogeeks]

2011-09-06 Thread siddharam suresh
at 10:51 AM, siddharam suresh siddharam@gmail.com wrote: *main()* is an address/probably the function pointer, Thank you, Sid. On Tue, Sep 6, 2011 at 11:19 PM, Sanjay Rajpal srn...@gmail.com wrote: #include stdio.h #includeconio.h int main() { printf( %d,sizeof(main

Re: [algogeeks] Re:

2011-09-06 Thread siddharam suresh
its size of return type, but why the above program not showing segmentation fault? Thank you, Sid. On Tue, Sep 6, 2011 at 11:34 PM, ankush garg agb.g...@gmail.com wrote: better contact AKSHAY CHADHA .. the person is quite good at c and algos currently placed in MICROSOFT..

Re: [algogeeks] Re:

2011-09-06 Thread siddharam suresh
PM, siddharam suresh siddharam@gmail.comwrote: its size of return type, but why the above program not showing segmentation fault? Thank you, Sid. On Tue, Sep 6, 2011 at 11:34 PM, ankush garg agb.g...@gmail.com wrote: better contact AKSHAY CHADHA .. the person is quite good at c

Re: [algogeeks] Storage form variables

2011-09-05 Thread siddharam suresh
this question already answered, please search previous threads. Thank you, Sid. On Mon, Sep 5, 2011 at 2:40 PM, Nikita Jain nikitajain.k...@gmail.comwrote: Can someone please explain in which form local variables , global variables ,pointers, arrays stores i.e in stack or heap or in any

Re: [algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread siddharam suresh
it can done in with 2 stack(size/length of the each stack is hieght of the tree),(stack1,stack2) num_stack1=find the first element using in order (pushing the ancestor of the first element) in first stack. num_stack2=find the second element using in order (pushing the ancestor of the second

Re: [algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread siddharam suresh
the ancestor of the second element) in second stack. num_stack1=num_stack2=num_stack1num_stack2?num_stack1:num_stack2; while(stack1[num_stack1--]!=stack2[num_stack2--]); return (stack1[num_stack1]) Thank you, Sid. Thank you, Sid. On Sat, Sep 3, 2011 at 7:25 PM, siddharam suresh siddharam

Re: [algogeeks] arrays in c

2011-09-03 Thread siddharam suresh
you cant predect the o/p because u are assigning the memory address(16/32 bit) to the charecter variable(8bit). Thank you, Sid. On Sat, Sep 3, 2011 at 7:36 PM, teja bala pawanjalsa.t...@gmail.com wrote: arr means the base address of the entire character array if u increase it i.e arr++

Re: [algogeeks] Re: character count in array

2011-09-03 Thread siddharam suresh
sol already posted please search old thread Thank you, Sid. On Sat, Sep 3, 2011 at 8:01 PM, Ankuj Gupta ankuj2...@gmail.com wrote: If we take our input to be characters a-z ans A-Z then we require fixed space which can be treated as O(1). On Sep 3, 7:10 pm, teja bala

Re: [algogeeks] arrays in c

2011-09-03 Thread siddharam suresh
@Siddhartha: as per my knowledge, strings are stored in code segment(its read only place) please correct me if i m wrong. normal variable/pointer variable stored in stack. i dont know about array. Thank you, Sid. On Sat, Sep 3, 2011 at 8:30 PM, Siddhartha Banerjee thefourrup...@gmail.com

Re: [algogeeks] Padding....

2011-09-03 Thread siddharam suresh
each object in the structure will take one memory word.(if one object then its size of that object) Thank you, Sid. On Sat, Sep 3, 2011 at 10:27 PM, Debabrata Das debabrata.barunhal...@gmail.com wrote: how output is 12 on typical 32 bit system and why? #includestdio.h struct x { int y;

Re: [algogeeks] Re: Adding Two no without using any operator...??

2011-09-02 Thread siddharam suresh
if this is the case program can be rewritten to #Iincludestdio.h #includeconio.h void main() { int a,b,i; clrscr(); printf(enter 2 num:); scanf(%d%d,a,b); while(b--) a++; printf(%d,a); getch(); } Thank you, Sid. On Fri, Sep 2, 2011 at 11:30 AM, annarao kataru kataruanna...@gmail.comwrote:

Re: [algogeeks] Re: Adding Two no without using any operator...??

2011-08-29 Thread siddharam suresh
super Thank you, Sid. On Sun, Aug 28, 2011 at 7:42 AM, saurabh singh saurab...@gmail.com wrote: main() { int a=4,b=6; printf(\n%d\n,printf(%*s%*s,a,,b,)); } -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- You received this message because you are subscribed to

Re: [algogeeks] Re: Zig Zag tree traversal

2011-08-28 Thread siddharam suresh
if its only printing the values then int get_height(node temp) { if(temp!=NULL) { return(get_height(temp-L)get_height(temp-R)?(get_height(temp-L)+1):(get_height(temp-R)+1)); } return 0; } void get_width(node temp, int level,int direction) { if(temp==NULL) return 0; if(level==1)

Re: [algogeeks] Re: Zig Zag tree traversal

2011-08-28 Thread siddharam suresh
bit alteration to the max width problem, thats it nothing else. Thank you, Sid. On Sun, Aug 28, 2011 at 11:07 PM, siddharam suresh siddharam@gmail.comwrote: if its only printing the values then int get_height(node temp) { if(temp!=NULL) { return(get_height(temp-L)get_height

Re: [algogeeks] chanege in immutable string

2011-08-26 Thread siddharam suresh
as per my knowledge, in java String s=java; // S holds to java. s+=c c++; // now s is pointing to string javac c++ not the appended string (java+c c++) // strcat and append syntactically(o/p strings) are same but wrt to memory they differ Thank you, Siddharam On Fri, Aug 26, 2011 at

[algogeeks] is it possible to access data from memory location 0?

2011-08-26 Thread siddharam suresh
Thank you, Siddharam -- 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] is it possible to access data from memory location 0?

2011-08-26 Thread siddharam suresh
but its its valid address right Thank you, Sid. On Fri, Aug 26, 2011 at 8:16 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: no it results in segmentation fault On Fri, Aug 26, 2011 at 3:48 PM, siddharam suresh siddharam@gmail.com wrote: Thank you, Siddharam -- You

Re: [algogeeks]

2011-08-25 Thread siddharam suresh
gives an error as b is undeclared. BTW this prog swaps 2 number. Thank you, Siddharam On Fri, Aug 26, 2011 at 9:28 AM, SuDhir mIsHra sudhir08.mis...@gmail.comwrote: main() { int a=10,20; a^=b^=a^=b; printf(%d\n %d\n,a,b); -- You received this message because you are subscribed to

Re: [algogeeks] Re: Process memory Layout

2011-08-22 Thread siddharam suresh
string are stored in fixed memory locations(thats why they called as immutable). alteration to that memory location is not allowed. Thank you, Siddharam On Mon, Aug 22, 2011 at 3:05 PM, aditi garg aditi.garg.6...@gmail.comwrote: @ kumar if we hav char *p=hello world; p[5]= 'a'; it

Re: [algogeeks] Re: C dot

2011-08-22 Thread siddharam suresh
how much they are offering ? Thank you, Siddharam On Tue, Aug 23, 2011 at 11:12 AM, ranjith kumar v.ranjithcar...@gmail.comwrote: They shortlist candidates based on cgpa and select the highest cgpa candidate. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] how to read arrow keys from the keyboard(like getch() in gcc)

2011-08-19 Thread siddharam suresh
and match with their ascii codes.i suppose this should work -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 19, 2011 at 1:46 PM, siddharam suresh siddharam@gmail.com wrote: Thank you, Siddharam -- You received this message

Re: [algogeeks] Re: Amazon Question

2011-08-18 Thread siddharam suresh
use (dynamic/ infinite)array initial the array with -1. insert(int a) { array[a]=a; } delete(int a) { array[a]=-1; } .. Thank you, Siddharam On Thu, Aug 18, 2011 at 7:54 PM, DheerajSharma dheerajsharma1...@gmail.comwrote: bitset would work i guess On Aug 18, 7:10 pm, hary rathor

Re: [algogeeks] Adobe off campus event

2011-08-18 Thread siddharam suresh
guys please keep updating about any off campus event Thank you, Siddharam On Thu, Aug 18, 2011 at 10:28 PM, rubal singh singhisru...@gmail.comwrote: Is Adobe open now for offcampus recruitment?? Regards Rubal Singh On Thu, Aug 18, 2011 at 5:11 PM, anon kaustubh.c...@gmail.com wrote: Has

Re: [algogeeks] Re: find numbers whose difference is min

2011-08-16 Thread siddharam suresh
i feel, this problem look similar to nearest point problem. algo is there in cormen book Thank you, Siddharam On Wed, Aug 17, 2011 at 10:19 AM, Ankuj Gupta ankuj2...@gmail.com wrote: We can modify it by keeping track of minimum element as well and find diff of that with all elements(say

Re: [algogeeks] MS question

2011-08-15 Thread siddharam suresh
trie nor link list is the answer may be you have to make ur own data structure using array of structure having elements like long carry, long long number and all.. i m not sure On Mon, Aug 15, 2011 at 11:21 AM, siddharam suresh siddharam@gmail.com wrote: i feel, doubly linked list

Re: [algogeeks] Re: find numbers whose difference is min

2011-08-15 Thread siddharam suresh
i feel, it can be done in O(n), find the median of the array, remove the median from the array, again find the median of the array(put back the first median to the array). difference of these two element will be min. Thank you, Siddharam On Tue, Aug 16, 2011 at 10:40 AM, Dave

Re: [algogeeks] Re: fork() question

2011-08-14 Thread siddharam suresh
do somebody tried the redirecting the output to file??? sometime results are unpredictable Thank you, Siddharam On Sun, Aug 14, 2011 at 11:25 PM, Yasir yasir@gmail.com wrote: Check out second run of same code: http://ideone.com/TK4qu. This time it printed only 8 times. The reason behind

Re: [algogeeks] MS question

2011-08-14 Thread siddharam suresh
i feel, doubly linked list. Whenever addition/subtraction is done we take/put the from/to to next digit. in doubly linked list its easy to move/go back and forth. Thank you, Siddharam On Mon, Aug 15, 2011 at 8:41 AM, ankit sambyal ankitsamb...@gmail.comwrote: @sagar : What is the best answer

Re: [algogeeks] Re: Problems on Linked List

2011-08-13 Thread siddharam suresh
yes you are right Thank you, Siddharam On Thu, Aug 11, 2011 at 10:21 AM, Abhishek gupta mailatabhishekgu...@gmail.com wrote: Q2). i think for second question it will be enough to just swap the data of current node to next node, and delete the next node. it will be like, //for swap int

Re: [algogeeks] c output doubt

2011-08-12 Thread siddharam suresh
4*(sizeof(int *)) Thank you, Siddharam On Fri, Aug 12, 2011 at 11:56 AM, Varun Jakhoria varunjakho...@gmail.comwrote: i didn't tried it .. but it might be internal conversion only , like whenever we do +1 to the address of int it automatically convert it into +4(i.e int size) On Fri, Aug

Re: [algogeeks] Re: amazon help

2011-08-12 Thread siddharam suresh
as i told download the book called cracking the coding interview , if you read/workout the problems thats enough, i feel. Thank you, Siddharam On Fri, Aug 12, 2011 at 5:53 PM, WgpShashank shashank7andr...@gmail.comwrote: @Prem, akashmkj, Thanks Geeks, Whenever you read any post , do notify me

Re: [algogeeks] find a solution

2011-08-11 Thread siddharam suresh
@gaurav.menghani: google has answer for every interview question asked. if people know how to search, then no need to join this group. Thank you, Siddharam On Thu, Aug 11, 2011 at 7:01 PM, Gaurav Menghani gaurav.mengh...@gmail.comwrote: I guess we should learn to google first. On Thu, Aug

Re: [algogeeks] amazon help

2011-08-11 Thread siddharam suresh
down load the book called **Cracking the Coding Interview, Fourth Edition: 150 Programming Interview Questions and Solutions*.* * * it contains max salutions Thank you, Siddharam On Fri, Aug 12, 2011 at 10:22 AM, Akash Mukherjee akash...@gmail.comwrote: thanx :) On Fri, Aug 12, 2011 at 7:51

Re: [algogeeks] amazon help

2011-08-11 Thread siddharam suresh
Thank you, Siddharam On Fri, Aug 12, 2011 at 10:34 AM, siddharam suresh siddharam@gmail.comwrote: down load the book called **Cracking the Coding Interview, Fourth Edition: 150 Programming Interview Questions and Solutions*.* * * it contains max solutions Thank you, Siddharam

Re: [algogeeks] find a solution

2011-08-11 Thread siddharam suresh
, siddharam suresh siddharam@gmail.comwrote: gaurav: i feel we dont know when the people have joined this group and what they want. post the answer if you are willing, otherwise just ignore it. Its better we should see the workability of the group. Thank you, Siddharam On Fri, Aug 12

Re: [algogeeks]

2011-08-10 Thread siddharam suresh
depends on the compiler to compiler Thank you, Siddharam On Wed, Aug 10, 2011 at 3:53 PM, Rajeshwar Patra rajeshwarpa...@gmail.comwrote: can someone predict the output and give an explanation main() { int i=5; printf(%d %d %d %d %d,i++,i--,++i,--i,i); } -- *Rajeshwar Patra,*

Re: [algogeeks]

2011-08-10 Thread siddharam suresh
the evaluation of parameters in printf() done from right to left. Thank you, Siddharam On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.comwrote: can anybody explain how its printing 4 5 5 4 5 -- You received this message because you are subscribed to the Google

Re: [algogeeks] Problems on Linked List

2011-08-10 Thread siddharam suresh
1)similar to list palindrome problem(soln already there in net) 2)it has discussed 2 day before on same group. please search once Thank you, Siddharam On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.com wrote: @naveen for the first one,how will u traverse the list backwards..

Re: [algogeeks] os

2011-08-10 Thread siddharam suresh
shortest preemptive job first Thank you, Siddharam On Thu, Aug 11, 2011 at 10:49 AM, krishna meena krishna.meena...@gmail.comwrote: Consider a set of n teaks with known runtimes r1,r2,r3rn to be run on a uni-processor machine. which processor scheduling algorithm will result in the

Re: [algogeeks] MS question

2011-08-09 Thread siddharam suresh
#includestdio.h #includestring.h #includestdlib.h char * squeez(char *str) { char temp1[100]; char * temp; temp=(char *) malloc(strlen(str)+1); int start=0,cursor=0; char mychar; while(str[start]!='\0') { mychar=str[start]; while(str[start]==str[start+cursor]) cursor ++; if(cursor==1)

Re: [algogeeks] MS question

2011-08-09 Thread siddharam suresh
saurabh test my program please tell me if any bug is there Thank you, Siddharam On Tue, Aug 9, 2011 at 8:18 PM, saurabh singh saurab...@gmail.com wrote: The code failed for all test cases I tried. On Tue, Aug 9, 2011 at 8:15 PM, ankit sambyal ankitsamb...@gmail.comwrote: ya got it

Re: [algogeeks] Re: Amazon Puzzle

2011-08-08 Thread siddharam suresh
i feel, 1st person who jumps he just writes the time at he jumped. second person(my assumption) may be having the compass and watch to calculate the direction(of the 1st person) on his page/paper. Thank you, Siddharam On Mon, Aug 8, 2011 at 11:30 AM, Venkat venkataharishan...@gmail.comwrote:

Re: [algogeeks] help--code

2011-08-08 Thread siddharam suresh
nice explanation gaurav Thank you, Siddharam On Mon, Aug 8, 2011 at 5:17 PM, Gaurav Menghani gaurav.mengh...@gmail.comwrote: The principle of locality of reference suggests if a reference is made to a memory location, next reference is close to it. So, it is a basic assumption that

Re: [algogeeks] Re: Link list problem..

2011-08-08 Thread siddharam suresh
both are possible in O(1) deletion: copy the next node (data and pointer) to current node(data and pointer). delete the next node. insertion: reverse of delete. Thank you, Siddharam On Mon, Aug 8, 2011 at 9:54 PM, Debabrata Das debabrata.barunhal...@gmail.com wrote: ok deletion is possible

Re: [algogeeks] amazon test question!!!

2011-08-08 Thread siddharam suresh
i feel ans is 1 Thank you, Siddharam On Mon, Aug 8, 2011 at 10:56 PM, sukran dhawan sukrandha...@gmail.comwrote: deletes all nodes in the tree.basically it tarverses in postorder and when it is a leaf it deletes the node On Mon, Aug 8, 2011 at 10:21 PM, rohit rajuljain...@gmail.com wrote:

Re: [algogeeks] Re: amazon question

2011-08-08 Thread siddharam suresh
@ankit:i feel you are right!!! Thank you, Siddharam On Mon, Aug 8, 2011 at 10:56 PM, ankit sambyal ankitsamb...@gmail.comwrote: the order of printfs depend on the scheduling algorithms which OS is following and can't be predicted -- You received this message because you are subscribed to

Re: [algogeeks] amazon test question!!!

2011-08-08 Thread siddharam suresh
func( Node *node){ if( node-left == NULL node-right == NULL ) delete(node); if(node-right != NULL) func( node-right); if(node-left != NULL) func( node-left); } for this code option 3 is correct Thank you, Siddharam On Mon, Aug 8, 2011 at 11:03 PM, rajul jain

Re: [algogeeks]

2011-08-08 Thread siddharam suresh
which company? Thank you, Siddharam On Mon, Aug 8, 2011 at 11:07 PM, mridula tripathi mridula.pi...@gmail.comwrote: hey i have HR interview tommorow...that too telephonic...how do i prepare...?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks]

2011-08-08 Thread siddharam suresh
:10 PM, mridula tripathi mridula.pi...@gmail.comwrote: success factors On Mon, Aug 8, 2011 at 11:08 PM, siddharam suresh siddharam@gmail.com wrote: which company? Thank you, Siddharam On Mon, Aug 8, 2011 at 11:07 PM, mridula tripathi mridula.pi...@gmail.com wrote: hey i have HR

Re: [algogeeks]

2011-08-08 Thread siddharam suresh
:) Thank you, Siddharam On Mon, Aug 8, 2011 at 11:18 PM, mridula tripathi mridula.pi...@gmail.comwrote: hey thnx... :) On Mon, Aug 8, 2011 at 11:17 PM, siddharam suresh siddharam@gmail.com wrote: i was just reading these http://www.job-interview-wisdom.com/phone-interview

Re: [algogeeks] amazon question

2011-08-08 Thread siddharam suresh
is it 3 ? Thank you, Siddharam On Mon, Aug 8, 2011 at 11:24 PM, rajul jain rajuljain...@gmail.com wrote: How many Children process following program produce * void main() { int p1= fork(); if (p1 == 0) { int p2 = fork(); if (p2 != 0) {

Re: [algogeeks] MICROSOFT INTERVIEW QUESTIONS faced by my frenz nd me

2011-08-07 Thread siddharam suresh
y'day i have attended the MS test. Following are the questions. 1)there are two arrays a={1,2,3} b={4,5,6,7,0,0,0}, b has enough space to accommodate the elements of a[] that is trailing 0's in b. o/p should be sorted array containing both the elements of a[] n b[] in above example

Re: [algogeeks] MICROSOFT INTERVIEW QUESTIONS faced by my frenz nd me

2011-08-07 Thread siddharam suresh
Thank you, Siddharam On Mon, Aug 8, 2011 at 10:14 AM, siddharam suresh siddharam@gmail.comwrote: y'day i have attended the MS test. Following are the questions. 1)there are two arrays a={1,2,3} b={4,5,6,7,0,0,0}, b has enough space to accommodate the elements of a[] that is trailing 0

Re: [algogeeks] Re: Microsoft :)

2011-08-06 Thread siddharam suresh
congrats Thank you, Siddharam On Sat, Aug 6, 2011 at 1:34 PM, Ragu ragu...@gmail.com wrote: Congrats dude... On 6 August 2011 13:07, KK kunalkapadi...@gmail.com wrote: Hey Congrats!! :) I got intern dere :) -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] How remove error?

2011-08-06 Thread siddharam suresh
is this *i%2=i%3 *valid statement? Thank you, Siddharam On Sat, Aug 6, 2011 at 3:23 PM, Rajesh Kumar testalgori...@gmail.comwrote: How remoe error of this code? #includestdio.h main() { int i=10,j=15; if(i%2=i%3) printf(\ncharacter); } -- Regards Rajesh Kumar -- You received

Re: [algogeeks] Selection in O(log n)

2011-08-06 Thread siddharam suresh
take the median of both the array MX, MY. (MX+1 means next element to MX in array X. lly to MY+1) recursively search till you get (MX MY MX+1) (then return MY) or (MYMXMY+1)(then return MX). Thank you, Siddharam On Sat, Aug 6, 2011 at 3:45 PM, kumar raja rajkumar.cs...@gmail.com wrote: X,Y

[algogeeks] difference b/w static variable,malloc variable and global variable

2011-08-06 Thread siddharam suresh
please tell what are the difference(scope) b/w static variable, variable defined by malloc and global variable. Thank you, Siddharam On Sat, Aug 6, 2011 at 3:52 PM, siddharam suresh siddharam@gmail.comwrote: take the median of both the array MX, MY. (MX+1 means next element to MX

Re: [algogeeks] Error in code?plz help...

2011-08-06 Thread siddharam suresh
Thank you, Siddharam On Sat, Aug 6, 2011 at 4:05 PM, Rajesh Kumar testalgori...@gmail.comwrote: How to remove error in this code? #includestdio.h main() { int i=10,j=15; if(i=j%3) printf(\ncharacter); } -- Regards Rajesh Kumar -- You received this message because you are

Re: [algogeeks] Selection in O(log n)

2011-08-06 Thread siddharam suresh
sorry people my explanation was incomplete. give time i will pass one the complete code. Thank you, Siddharam On Sat, Aug 6, 2011 at 3:52 PM, siddharam suresh siddharam@gmail.comwrote: take the median of both the array MX, MY. (MX+1 means next element to MX in array X. lly to MY+1

Re: [algogeeks] MS test

2011-08-06 Thread siddharam suresh
is 2nd question is similar to Fibonacci series ? Thank you, Siddharam On Sat, Aug 6, 2011 at 10:20 PM, ankit sambyal ankitsamb...@gmail.comwrote: ya the answer for 1st one is b -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] MS test

2011-08-06 Thread siddharam suresh
i feel 4th answer is 5. Thank you, Siddharam On Sat, Aug 6, 2011 at 10:26 PM, sukran dhawan sukrandha...@gmail.comwrote: could u plz explain the 4th one? On Sat, Aug 6, 2011 at 10:20 PM, ankit sambyal ankitsamb...@gmail.comwrote: ya the answer for 1st one is b -- You received this

Re: [algogeeks] MS test

2011-08-06 Thread siddharam suresh
what is *Page segmentation?* Thank you, Siddharam On Sat, Aug 6, 2011 at 10:35 PM, ankit sambyal ankitsamb...@gmail.comwrote: @neha: Cud u explain how r u getting d option for ques 4 ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
my idea is go for inorder traversal find the longest sorted sequence in traversal thats the *'largest BST in a binary tree.'* Thank you, Siddharam On Fri, Aug 5, 2011 at 10:00 AM, Aman Goyal aman.goya...@gmail.com wrote: while dequing a node from the queue, how will u check whether a bst

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
AM, siddharam suresh siddharam@gmail.com wrote: my idea is go for inorder traversal find the longest sorted sequence in traversal thats the *'largest BST in a binary tree.'* Thank you, Siddharam On Fri, Aug 5, 2011 at 10:00 AM, Aman Goyal aman.goya...@gmail.comwrote: while dequing

Re: [algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
@ toarunb...@gmail.com: can you tell me flaw in algo(or sample input)! Thank you, Siddharam On Fri, Aug 5, 2011 at 10:28 AM, Arun toarunb...@gmail.com wrote: @Sidharam I dont think your idea goes along with the sample i/p o/p On Aug 5, 9:35 am, siddharam suresh siddharam@gmail.com

[algogeeks] MICRSOFT WRITEN TEST

2011-08-04 Thread siddharam suresh
a point.It should be fine. On Aug 5, 10:00 am, siddharam suresh siddharam@gmail.com wrote: @ toarunb...@gmail.com: can you tell me flaw in algo(or sample input)! Thank you, Siddharam On Fri, Aug 5, 2011 at 10:28 AM, Arun toarunb...@gmail.com wrote: @Sidharam I dont

Re: [algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
. On 5 August 2011 10:38, Arun toarunb...@gmail.com wrote: @Sidharam Sorry! I just missed a point.It should be fine. On Aug 5, 10:00 am, siddharam suresh siddharam@gmail.com wrote: @ toarunb...@gmail.com: can you tell me flaw in algo(or sample input)! Thank you, Siddharam

Re: [algogeeks] MICRSOFT WRITEN TEST

2011-08-04 Thread siddharam suresh
thank you Thank you, Siddharam On Fri, Aug 5, 2011 at 10:51 AM, Poised~ dip10c...@gmail.com wrote: try this: https://groups.google.com/forum/?hl=en#!topic/algogeeks/Mbah1QXrJB4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view