[algogeeks] Sites for Interview Questions

2011-01-18 Thread Yellow Sapphire
Hi, Can someone suggest good books/websites/blogs for interview related questions. thanks-- YS -- 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,

Re: [algogeeks] Re: Number problem

2010-09-25 Thread Yellow Sapphire
My code failed because it was reversing the digits and thus 0 was getting added in the front which resulted in nothing. If allowed we can use a char array else will have to find a solution which does not reverse the digits of the number. -- You received this message because you are subscribed

Re: [algogeeks] Re: do this: two numbers with min diff

2010-09-23 Thread Yellow Sapphire
I hope this will work. It finds the two minimum numbers and then prints the difference. #include stdio.h #include stdlib.h void find_two_mins(int array[], int size) { int i,t; int min1=array[0], min2=array[1]; for (i=2; isize; i++){ t=array[i]; if(t=min1) {

[algogeeks] Re: Unbounded dictionary lookup

2010-09-22 Thread Yellow Sapphire
In case of a dictionary, can we assume that its a Sorted list of words? On Sep 22, 12:42 pm, ramdas kale ramda...@gmail.com wrote: If we take high = MAX_CAPACITY Here MAX_CAPACITY denotes the maximum no of words dictinary can index. Actual no of words stored in dictionary could be less than

[algogeeks] Re: Inserting a box with lesser dimension into a box of bigger dimensions than that.

2010-09-22 Thread Yellow Sapphire
We can first sort the dimensions of each box. For example if the dimensions of a box is L=10, B=12, W=6 then convert it to L=12, B=10, W=6. The above step is not needed if the problem states that LBH for all boxes. Then using a multi-key sorting we can sort all the boxes in ascending order (or

[algogeeks] Re: Print 1 to n one per each line on the standard output

2010-09-22 Thread Yellow Sapphire
The question is to get an algorithm or a program. If it's a program then using execl() or fork() system call you can code this. The code will not be a recursion in a sense that we will not call functions recursively but will call the programs (executable code) recursively. On Sep 22, 8:49 pm,