[algogeeks] Regarding approach to solve

2014-09-28 Thread Ravi Ranjan
Yesterday I appeared for ACM USA Regionals, there I got the problem https://icpc-qual-14.kattis.com/problems/flipfive Can anyone help how to solve this kind of problem. Any links for similar problems ? -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Adobe question

2013-06-20 Thread Ravi Ranjan
There is a Blank Paper Sheet, Given a list of characters and their sizes, for ex. A, P, O, N, Q with different font sizes and designs. Now we need to cut characters from given sheet of paper of all sizes atleast once. And also try to maxmize number of characters cut. Along with this, when you

Re: [algogeeks] Amazon interview Questions

2013-06-05 Thread Ravi Ranjan
Can u clear Round3 --- Qstn-3. the language is not cleared On Wed, Jun 5, 2013 at 1:52 PM, sourabh jain wsour...@gmail.com wrote: Round 1: 1.Design a Data Structure supporting 3 queries a)push b)pop c) find minimum Ans : Do it using Two Stacks . in first stack use it as normal stack.

Re: [algogeeks] Minimum number of coins to SUM to S

2013-05-29 Thread Ravi Ranjan
@DAve any proper reason or link to proof that at least twice can be solved using greedy but others are not?? On Tue, May 28, 2013 at 12:41 PM, Shashwat Kumar shashwatkmr@gmail.comwrote: This seems to be Coin Change problem. Just google that. On Tue, May 28, 2013 at 12:42 AM, Adolfo

[algogeeks] sortin 2D array

2013-01-08 Thread Ravi Ranjan
You have a two dimensional array of size m*n. The elements in the rows are sorted and every row has unique elements means( in a row no two elements are same) but the elements can repeat across the rows. For example: you have following 2-D array: 2 5 7 9 14 16 3 6 8 10 15 21 4 7 9 15 22 35 7 8 9 22

[algogeeks] ACM World Finals

2012-11-29 Thread Ravi Ranjan
qstn src--- http://cm.baylor.edu/ICPCWiki/attach/Problem%20Resources/2008WorldFinalsProblemSet.pdf the first problem Problem A Air Conditioning Machinery I did it through backtracking but is there in other n good approach to solve it. can DP be used?? Any Specific algorithm exists for

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Ravi Ranjan
biku u also dere in this group... coool bro :) -- 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] microsoft_c++_qstn

2012-09-25 Thread Ravi Ranjan
#includeiostream.h int rec(int i) { static int d=1; if(i=5) return i; d=d+i; i=i+i; rec(d); } int main() { coutrec(1); return 0; } various compilers give diffrent result... why so??? n how d value is calculated by differnt compilers.. whhat is d correct output n which compiler to trust?? -- You

Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread Ravi Ranjan
@atul so 8 will be the answer or is it not fixed??? -- 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

Re: [algogeeks] need help??

2012-09-22 Thread Ravi Ranjan
khalid mugal - A Programmers guide to Java certification -- 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

Re: [algogeeks] help to give DP solution

2012-09-15 Thread Ravi Ranjan
@atul agreed with u dat it can be solved through hungarian method.. but what about the condition a[i][i] entry is invalid if all elements lie on diagonal n d sum is also maximum den a[i][i] condition will be violated but Hungarian method still works -- You received this message because you are

Re: [algogeeks] REARRANGE

2012-09-10 Thread Ravi Ranjan
use quad tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this

[algogeeks] amazon Interview

2012-08-26 Thread Ravi Ranjan
You are given many slabs each with a length and a breadth. A slab i can be put on slab j if both dimensions of i are less than that of j. In this similar manner, you can keep on putting slabs on each other. Find the maximum stack possible which you can create out of the given slabs and for

Re: [algogeeks] Re: [Off topic]Privacy Policies in gmail

2012-08-22 Thread Ravi Ranjan
@all they might use all the info n someone else can publish his book on algorithm problems -- 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] MS Question: Segregrate positive and negative nos in array without changing order

2012-06-29 Thread Ravi Ranjan
one can modify dutch national flag algo for two colors(2 types positive n negative) -- 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] Facebook qsrtn

2012-05-01 Thread Ravi Ranjan
We have been given a deck of cards and each combination has a rating eg 3 As is higher than 2 As 1K etc. Write an algorithm such that the probability of picking 3 or 5 or 7 cards from the deck results in high rating plzzz tell how to approach these kind of problems??? -- You received this

Re: [algogeeks] Re: Algorithm page

2012-04-13 Thread Ravi Ranjan
@wladimir can u upsate the site in English??? -- 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

Re: [algogeeks] Google written test

2012-03-17 Thread Ravi Ranjan
@ if for a given number more than 1 answer exist then whats the answer??? -- 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

Re: [algogeeks] Re: thanx to all

2012-03-01 Thread Ravi Ranjan
@atul two nodes were given in the qstn... i did 1) calculate the level of one node through level order traversal similarly for other 2) then find the Least Common Anscestor 3) then dist(LCS - node1) + dist(LCS - node2) but i think this was not optimized bcse he was not very much satisfied

Re: [algogeeks] Re: thanx to all

2012-03-01 Thread Ravi Ranjan
@atul thanx dude.. yeah it is the soln... i think in interview i quite tired thats why unable to think in this simle way... again thanx a lot atul and all other GEEKS :) :) -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] thanx to all

2012-02-29 Thread Ravi Ranjan
@all 3 round liye 1.5 hours each only data structure n algorithm n 2 qstns from OS but ultimately the code for synchronization(a mix situation of linked-list n semaphore) they asked linked list tree programs their variations(all to implement in C) i stuck at this place when they tell me to

[algogeeks] thanx to all

2012-02-28 Thread Ravi Ranjan
hey Geeks thanx a lot .. for the valuable information in the discussions i got selected in Yatra.com (R n D profile) thanx a lot for the algorithms explained by to guys THANX A LOT :D:D:D:D -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: google question

2012-02-26 Thread Ravi Ranjan
@all same doubt qstn appears to be of binary tree DS but the diagram given in between qstn is not like Binary tree so sharing is there so how sharing is done plz explain?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] google question

2012-02-25 Thread Ravi Ranjan
|_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| Each cup has capacity C and once a cup gets full, it drops half extra amount to left child and half extra amount to right child for Eg : let' first cups get 2C amount of liquid then extra amount C(2C-C) will be divided equally to left

[algogeeks] output C

2012-02-25 Thread Ravi Ranjan
#include stdio.h #include stdlib.h #define SIZEOF(arr) (sizeof(arr)/sizeof(arr[0])) #define PrintInt(expr) printf(%s:%d\n,#expr,(expr)) int main(int argc, char *argv[]) { /* The powers of 10 */ int pot[] = { 0001, 0010, 0100, 1000 };

Re: [algogeeks] C concept on memory layout

2012-02-07 Thread Ravi Ranjan
@all thanx for the explanation.. -- 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] hint

2012-02-06 Thread Ravi Ranjan
guys.. can u please refer me the best book for graph theory for algorithm purpose thanx ravi -- 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

[algogeeks] C concept on memory layout

2012-02-06 Thread Ravi Ranjan
i have a confusion in it #include stdio.h #include stdlib.h void add(int,int); int main(int argc, char *argv[]) { add(6,3); printf(%d,p); system(PAUSE); return 0; } void add(int a, int b) { static int p; p = a+ b; } here the memory layout says variable p is in BSS segment ... so

[algogeeks] nvidia qstn

2012-02-03 Thread Ravi Ranjan
Implement a MS key suggest like tool where on typing the first letters will give a list of words starting with the typed text. The corpus will be provided as a text file. Max number of characters in a word is 10. - Say you type 'i', it should provide 'include | if ' as the words in the dropdown

Re: [algogeeks] Re: Reverse Engg.

2012-02-01 Thread Ravi Ranjan
@atul true... :P:P:P:P and definately linux will develop within a year after release of windows95...:P On Jan 30, 11:20 am, Karthikeyan V.B kartmu...@gmail.com wrote: hi, can anyone tell me how i can convert exe back to c source? -- You received this message because you

Re: [algogeeks] Reverse Engg.

2012-01-30 Thread Ravi Ranjan
its not possible to convert exe back to C. u can get the assembly code of that only. for that u can use the tool IDA or olly debugger -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] spell check

2012-01-28 Thread Ravi Ranjan
i wanna write the spell check function like when we put some word with spelling mistake then it tell the most suitable word matching to it( green error line of spelling in MS-Word) i used levenshtein distance algorithm to find the subset from the dictionary but it is a linear search... and

Re: [algogeeks] Re: algo qstn

2012-01-18 Thread Ravi Ranjan
i m searching for the approach to solve. can u please tell the approach instead of answer -- 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: rectangle of max sum MS Q

2012-01-16 Thread Ravi Ranjan
@all it was said subset rectangle with max sum. since every square is also a rectangle for m*n take the square matrix of n*n (nm) only m -n +1 options will have to comareuse backtracking to compare the next column's sum to present it will take O(n) time using backtracking.. please

[algogeeks] algo qstn

2012-01-16 Thread Ravi Ranjan
An ant moves on a regular grid of squares that are coloured either black or white. The ant is always oriented in one of the cardinal directions (left, right, up or down) and moves from square to adjacent square according to the following rules: - if it is on a black square, it flips the color of

[algogeeks]

2012-01-11 Thread Ravi Ranjan
*Problem 1: Number of Tilings, (K Narayan Kumar, CMI)* You have to tile a room that is two units wide and *N* units long. You have with you two types of tiles: a rectangle that is one unit wide and two units long, and an L-shaped tile covering three square units. Here are pictures of the two

Re: [algogeeks] Re: Divide the Square into 2 parts

2011-12-31 Thread Ravi Ranjan
@ dave what about the problem if it dsnt satisfy the 2 conditions(odd/even) -- 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

Re: [algogeeks] ACM-ICPC Kanpur 2011 LCM Extreme

2011-12-18 Thread Ravi Ranjan
use eucleid algorithm to calculate HCF n den use function a * b = HCF*LCM 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

Re: [algogeeks] Interesting Liked List problem..Suggest Algo

2011-12-15 Thread Ravi Ranjan
traversing the entire linklist one can determine the merge point -- Ravi Ranjan Sinha final yr computer science NIT Jalandhar 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

Re: [algogeeks] Interesting Liked List problem..Suggest Algo

2011-12-15 Thread Ravi Ranjan
i got my mistake.. den how to fulfill all the conditions?? -- 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

Re: [algogeeks] virtual destructor problem

2011-12-07 Thread Ravi Ranjan
here conversion from derived to base class takes place so finally only base class get called output will be baseClass Des called -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] virtual destructor problem

2011-12-07 Thread Ravi Ranjan
ya i tried it on dev c++ dats why i m telling.. -- 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