[algogeeks] Openings in Mentor Graphics,Noida Location

2015-11-16 Thread Ashish kumar Jain
Anybody interested to join Mentor Graphics Noida having 1-10 years of experience in C/C++/DS/Algo can forward his/her resume to me. Please understand that the opening needs to be closed urgently.So,Hurry up. Note: Please ignore if inappropriate for this forum. -- Regards, Ashish -- You

[algogeeks] Openings in Adobe India !!!

2014-10-14 Thread Ashish Mehta
. - In case of any college from where Adobe does not hire developers. I would recommend that you have something concrete in your resume so that I can talk to HR with confidence. :) Do mention this in the mail. Regards, Ashish -- You received this message because you are subscribed

Re: [algogeeks] MS written Reasoning question

2013-05-02 Thread ashish gupta
ans would be (d) option (b) is not correct as it says that only 2 mba and only 1 mca are selected but the total no of selected candidates are 6. -- Ashish On Fri, Apr 26, 2013 at 11:32 PM, rahul sharma rahul23111...@gmail.comwrote: 10 candidates appear for an interview and 6 selected. 2-M.A

[algogeeks] MS Question:WAP to print last n lines of a log file

2013-03-03 Thread Ashish Goel
Q1. Given a log file, pirnt last n lines. Note that the Log file is being written into. Q2. Implement Circular Buffer. Best Regards Ashish Goel Think positive and find fuel in failure -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: HOW TO CALCULATE THA size of union

2012-12-10 Thread ashish mann
union A{ long int y[5]; union B{ double g; union C{ int k; union D{ char ch; int x[5]; };

[algogeeks] substring in big string

2012-10-17 Thread Ashish Goel
there is a big string which needs 2GB memory to fit in but you have only 100mb. Find a substring in the big string. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] spoj problem EASYMATH

2012-09-27 Thread ashish pant
thanks for your reply.. actually i was thinking the same thing.. but I am facing problems in finding the unique multiples of a+3d and a+4d as applying inclusion exclusion principle in this way is getting too difficult due to large no of factors to be added and subtracted.. is der any other

Re: [algogeeks] Data Structure

2012-09-18 Thread Ashish Goel
stack Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Sep 18, 2012 at 3:55 PM, Sheetal Naidu kartiknaid...@gmail.comwrote: sqlite database for mozilla...maybe hashtable On 18 September 2012 13:20, Navin Kumar algorithm.i...@gmail.com

Re: [algogeeks] Re: adobe question help

2012-09-13 Thread Ashish Goel
this is from KR exercise :) Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Sep 12, 2012 at 4:14 PM, Navin Gupta navin.nit...@gmail.com wrote: int temp = {[1(j-+1)]i-1}; Here temp is a number with all the bits set between positions i j

Re: [algogeeks] Finding top 10 most frequent repeated word

2012-09-11 Thread Ashish Goel
hashmap for word to count mapping and a heap will have count and corresponding words (will get updated at run time) Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Sep 11, 2012 at 2:07 PM, Navin Kumar algorithm.i...@gmail.comwrote: @ashish

Re: [algogeeks] Finding top 10 most frequent repeated word

2012-09-10 Thread Ashish Goel
map + heap for 10 most occurred words.. external sort for not sufficient memory if the words are dynamically added/deleted, the first map+heap should succeed. Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sat, Sep 8, 2012 at 8:06 PM, Kumar Vishal kumar

Re: [algogeeks] MICROSOFT:Given a BST and a number. Find two node in a BST whose sum is equal to given number in O(n) time and O(1) space.

2012-09-03 Thread Ashish Goel
what is right to left inorder? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Sep 3, 2012 at 1:13 PM, atul anand atul.87fri...@gmail.com wrote: @Dave : algo seems fine...but it seems to me that it would difficult to maintain both left

[algogeeks] LOGIC!!!

2012-08-30 Thread ashish mann
Q. A company organizes two foreign trips for its employees yearly. Aim of the trip is to increase interaction among the employees of the company and hence company wants each of his employee to see new people on the trip and not even a single person with whom he has worked in past. Therefore it is

[algogeeks] Amazon Q

2012-08-25 Thread Ashish Goel
if a linked list (each char is a node) is palindrome, recursively. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Re: MS interview

2012-08-23 Thread Ashish Goel
yes, that is correct. O(mn) to form multimap and then O(m) to tell all anagram groups Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, Aug 23, 2012 at 5:11 PM, kings dns.bhar...@gmail.com wrote: Dear GC, The efficient data structure in my

Re: [algogeeks] MS interview

2012-08-22 Thread Ashish Goel
O(n) convert each string into format a1b2and then insert into multimap wityh this a1b2...as key and original word as value. All words with same key are anagrams Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Aug 22, 2012 at 11:39 PM

Re: [algogeeks]

2012-08-19 Thread Ashish Goel
what is the rational to do 5*rand5() why not 4*rand5 or 6 *rand5?? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 22, 2012 at 10:13 AM, Anant Sharma black.b...@gmail.com wrote: The reason why finding a solution to this question

[algogeeks] AMAZON: given col id, print col name in excel

2012-08-08 Thread Ashish Goel
Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab, aac aax, aaz, aba, abc... (Its same as excel column names). Given an integer (n), generate n-th string from the above sequence. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652

Re: [algogeeks] Re: DE Shaw written test

2012-08-06 Thread Ashish Goel
{ finalMinIndex = minIndex; finalMaxIndex = maxIndex; maxIndex = -1;} } } if (maxIndex !=-1) {finalMinIndex = minIndex; finalMaxIndex = maxIndex;} Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Aug 5, 2012 at 11:36 PM, Navin Kumar navin.nit

Re: [algogeeks] DE Shaw written test

2012-08-06 Thread Ashish Goel
As i understand the question says, one time buy and one time sell, buy preceeds sell... if multiple such transactions allowed, we may need DP Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Aug 6, 2012 at 7:16 AM, umesh kewat umesh1

Re: [algogeeks] Local Minima in Unsorted Array

2012-08-04 Thread Ashish Goel
can you give an example of what do you mean by Local minima? From Dave's example, it looks like the minima of the whole array.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Aug 3, 2012 at 10:32 PM, shady sinv...@gmail.com wrote: Hi, Can

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Ashish Goel
Ishan, i am assuming that the list to BST should give a inorder traversal, and the logic of yours does not seem to give a right solution. try two different trees with 7 nodes, convert into LL and then back to BST, the answer is not same as the trees that we start with. Best Regards Ashish Goel

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Ashish Goel
can you give the link within geeksforgeeks please Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jul 31, 2012 at 4:13 PM, a g ag20071...@gmail.com wrote: check on geeksforgeeks.org On Tue, Jul 31, 2012 at 3:09 PM, Ashish Goel ashg

Re: [algogeeks] Microsoft first round interview question.

2012-08-02 Thread Ashish Goel
) { if (pCurr-child) { pTail-next = pCurr-child; pCurr-child-prev = pTail; while (pTail-next) pTail = pTail-next; } pCurr= pCurr-next; } return pDLL; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, Aug 2, 2012 at 5

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-07-31 Thread Ashish Goel
how would you do convert sorted doubly linked list to bst using same nodes as in DLL Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Jul 29, 2012 at 10:30 PM, Purani Sekar nagapur...@gmail.com wrote: convert sorted doubly linked list to bst

Re: [algogeeks] Programming Problem

2012-07-20 Thread ashish jain
' as the unique beautiful string. On Fri, Jul 20, 2012 at 12:22 PM, piyush khanna piyush_khanna2...@yahoo.com wrote: @ashish jain :then what for aaab.. -- *From:* ashish jain ashishjainco...@gmail.com *To:* algogeeks@googlegroups.com *Sent:* Thursday, July 19, 2012 9:48

Re: [algogeeks] Programming Problem

2012-07-19 Thread ashish jain
if from the string s.. a binary search tree (with higher value alphabets on the left side of the root and lower value alphabets on the right side of root) is formed removing the repeated characters during the formation of he BST and then applying inorder technique to get the string s2. String S2

Re: [algogeeks]

2012-07-15 Thread ashish jain
@Vindhya every time least is getting 101-'e' as the value. and not llo as the statement least = (*ptrleast ) ?(*ptr) :(least); is equivalent to if(*ptrleast) least=*ptr; so firstly it compares 127 with 'e' and least ='e' in next iteration , it compares l and e, so agn least = 'e' in next

Re: [algogeeks] C o/p

2012-07-08 Thread ashish jain
I think it should output: 9 9 On Sun, Jul 8, 2012 at 11:42 PM, md shaukat ali ali.mdshau...@gmail.comwrote: but i am confused in this problem... int a=10; int b; b=--a--; printf(%d %d,a,b);..what will output? On Sun, Jul 8, 2012 at 11:39 PM, md shaukat ali ali.mdshau...@gmail.comwrote:

Re: [algogeeks] Finding intersection of 2 linked lists

2012-07-05 Thread Ashish Goel
node *pNew = (struct node*)malloc(sizeof(struct node)); if !pNew return NULL; //scary pNew-data = pL1-data; pNew-next = NULL; if ( !pL3) pL3= pNew; else pL3Tail-next = pNew; pL3Tail = pNew; } return pL3; } } Best Regards Ashish Goel Think positive

Re: [algogeeks] Amazon Interview Question

2012-07-04 Thread Ashish Goel
; else removePrefix(prefix[k], prefixCount); prefix[prefixCount++] = String(a[i][j]; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 4, 2012 at 12:22 PM, Decipher ankurseth...@gmail.com wrote: Find the next higher

Re: [algogeeks] Amazon Interview Question

2012-07-04 Thread Ashish Goel
Q5 is sorting problem Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 4, 2012 at 4:13 PM, Ashish Goel ashg...@gmail.com wrote: 1. inverted hasp map 2. not clear 3. VLR, how do you identify end of L and start of R, question incomplete

Re: [algogeeks] Amazon Interview Question

2012-07-04 Thread Ashish Goel
]=s; continue;} else if isPrefix(s) prefix[prefixCount++] = s; else removePrefix(prefix[k], prefixCount); prefix[prefixCount++] = String(a[i][j]; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 4, 2012 at 4

Re: [algogeeks] serialize a binary tree

2012-07-04 Thread Ashish Goel
my understanding is to either write the level order traversal noting parent, child relation or write the adjacency list into a file where we store the edges Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 4, 2012 at 3:58 PM, adarsh kumar

[algogeeks] IV Question : Design Tatkal Seva (dev Question)

2012-07-03 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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

[algogeeks] serialize a binary tree

2012-07-03 Thread Ashish Goel
a] How would you serialize a binary tree in a file(improve it) b] serialization that you have chosen, write a code to reconstruct the tree Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed

[algogeeks] balanced tree

2012-07-03 Thread Ashish Goel
WAP to find if a tree is balanced/fully balanced? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Please help in understanding this question. I have no answers just this question.

2012-07-01 Thread Ashish Goel
count island problem On Jul 1, 2012, at 11:06 AM, Vikas wrote: Given matrix(screen black n white)..where 1 represents black dot and 0=white. there can b many images/objects in it..return list of coordinates for each obkect..(Hint do BFS) -- You received this message because you are

Re: [algogeeks] Microsoft interview qs

2012-06-30 Thread Ashish Goel
trie or ternary tree and build stack for the string being entered, keep distributed hashmap for head/tail queries like cricket, weather, finance etc various domains etc.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sat, Jun 30, 2012 at 12:05

[algogeeks] MS Question :implement read write lock class

2012-06-28 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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

[algogeeks] MS Question: Add two large numbers where the numbers are stored in an array format

2012-06-26 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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: Frequently one of the Top Question Asked in Amazon

2012-06-26 Thread Ashish Goel
This is zigzag problem where in addition to print, one needs to append the printed data to the resulting DLL at the tail. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Feb 1, 2011 at 6:12 PM, bittu shashank7andr...@gmail.com wrote

Re: [algogeeks] MS Question: Add two large numbers where the numbers are stored in an array format

2012-06-26 Thread Ashish Goel
the base is not given, so 10 can't be assumed Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 26, 2012 at 4:38 PM, amrit harry dabbcomput...@gmail.comwrote: make size of both array by adding '0' in front of smaller array then int

Re: [algogeeks] Re: Question asked in Amazon online test

2012-06-23 Thread ashish jain
@all yaa.. For getting number of swaps.. we have to calculate total number of zeroes on the right for each '1' and on adding them we will get the number of swaps. and in O(n) time. On Sat, Jun 23, 2012 at 1:16 PM, Guruprasad Sridharan sridharan.mi...@gmail.com wrote: It will work because we

Re: [algogeeks] Re: Directi question-centre of the tree

2012-06-21 Thread Ashish Goel
farthest from 2: Find a vertex v1 | the farthest form r. 3: Find a vertex v2 | the farthest form v1. won't v2 be farthest from r? or we are talking about alternate pats also Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 20, 2012

Re: [algogeeks] Microsoft question

2012-06-17 Thread Ashish Goel
is the modification of the given array allowed? if yes use quick select, otherwise build tree where each node keeps count of its left subtree Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Jun 17, 2012 at 8:13 AM, Prem Nagarajan prem.cmna

[algogeeks] print spiral

2012-06-15 Thread Ashish Goel
) (cs (n+1)/2)) { int r=rs; int c=cs; for (int j=c;jn-c-1;j++) printf(%d ,a[r][j]); for (int i=r;im-r-1;i++) printf(%d ,a[i][n-c-1]); for (int j=n-c-1;jc;j--) printf(%d ,a[m-r-1][j]); for (int i=m-r-1;ir;i--) printf(%d ,a[i][c]);; rs++;cs++; } } Best Regards Ashish Goel

[algogeeks] water trap

2012-06-15 Thread Ashish Goel
question @ http://www.leetcode.com/groups/twitter-interview/forum/topic/rain-water-trap-2d-version/ can someone help please Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] print spiral

2012-06-15 Thread Ashish Goel
yes, using count i solved this, but IMHO, this should be done without this count somehow.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 15, 2012 at 3:14 PM, utsav sharma utsav.sharm...@gmail.comwrote: check no. of elements printed

Re: [algogeeks] Re: Book Feedback needed for book from Narasimha Karumanchi

2012-06-15 Thread Ashish Goel
bought this book and i am quite impressed with the quantity and quality of code. Recommend this with programming pearls, prog interview exposed, cracking the coding interview. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sat, Jun 16, 2012 at 2

[algogeeks] MS Question: Reverse stack using push, pop without any auxiliary data structure

2012-06-14 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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: Reverse stack using push, pop without any auxiliary data structure

2012-06-14 Thread Ashish Goel
Navin: copy pastes not encouraged till the logic is also clarified ;) Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, Jun 14, 2012 at 7:25 PM, Sourabh Singh singhsourab...@gmail.comwrote: @ Navin Kumar Nice . Solution. But your

Re: [algogeeks] Microsoft Interview Question

2012-06-13 Thread Ashish Goel
int i=0; int j=n-1; while (ij) { while (ij) (a[i]=0) i++; while (ij) (a[j0) j--; if (ij) swap(a[i],a[j]); else break; i++; j--; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 13, 2012 at 9:49 PM, Krishna Kishore kknarenkris

Re: [algogeeks] MS Q: how to test a driverless car?

2012-06-08 Thread Ashish Goel
,school/hospital/potholes etc), capability to act on instructions from telematics agents for SoS(accidents, profile based paths/alterations,speed control as per laws), action on maintenance reminders, fuel auto-filling/auto-charging should drive the testing, . Best Regards Ashish Goel Think positive

Re: [algogeeks] Re: MS question : string compression

2012-06-08 Thread Ashish Goel
examples char *pNew = (char *)malloc(sizeof(char)*len); char *pDec = (char *)malloc(sizeof(char)*len); //rleSimple(pStr,pNew); rle(pStr,len,pNew); rleDecode(pNew, pDec, pStr); return 0; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 8

[algogeeks] Book Feedback needed for book from Narasimha Karumanchi

2012-06-08 Thread Ashish Goel
Hi, I came across Data Structures and Algorithms Made Easy: Data Structure and Algorithmic Puzzles Request for feedback if it is worth purchase. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed

Re: [algogeeks] first Repeating character in a string

2012-06-08 Thread Ashish Goel
again in the string. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 8, 2012 at 2:15 PM, himanshu kansal himanshukansal...@gmail.com wrote: how can we find 1st repeating character in string??? e.g. if the string is abba it should return

Re: [algogeeks] Re: MS question : string compression

2012-06-08 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 8, 2012 at 12:54 PM, Ashish Goel ashg...@gmail.com wrote: #include stdafx.h #include iostream using namespace std; const int len = 20; const int maxCount = 127; int rle(char* pStr

Re: [algogeeks] first Repeating character in a string

2012-06-08 Thread Ashish Goel
no hashtable needed , a bitmap is sufficient Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 8, 2012 at 4:04 PM, saurabh singh saurab...@gmail.com wrote: The key doesn't lies in the way it will be solved.It is how efficiently you

Re: [algogeeks] Finding largest zigzag subsequence

2012-06-08 Thread Ashish Goel
= true; } } } What i was thinking is to find the number of peaks and valleys through binary search thereby using log(n) solution not able to conceptualize it this way (:. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jun 8, 2012 at 3:47

Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2012-06-07 Thread ashish kumar
email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ashish Kumar Bharat Electronics Ltd Ghaziabad +91 8527110885 -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: MS question : string compression

2012-06-07 Thread Ashish Goel
the writing part too. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, Jun 7, 2012 at 7:05 PM, Navin Gupta navin.nit...@gmail.com wrote: If abcdef is changed to a1b1c1d1e1f1, then we need to allocate memory dynamically. Because length is increased,I

Re: [algogeeks] Re: amazon interview questions

2012-06-06 Thread Ashish Goel
Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081

Re: [algogeeks] Re: interview HARD problem

2012-06-06 Thread Ashish Goel
Gene, you are right, the rectangle is valid if rotated by 90 degrees too. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 7:45 PM, Gene gene.ress...@gmail.com wrote: Does this sufficae? Suppose you were using a dictionary

[algogeeks] 2 Dim array as parameter

2012-06-06 Thread Ashish Goel
Hi, traditional C style of passing 2D array to a C func is for example, void func(char **pArr, int m, int n). Like we validate a pointer before accessing it if it is valid, how do we verify that the array provided indeed has got memory allocated to it before accessing it Best Regards Ashish

[algogeeks] MS Question : find word in 2D array

2012-06-06 Thread Ashish Goel
WAP to find a word in a 2D array. The word can be formed on row/col/diagnal/reverse diagnal Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] MS Q: how to test a driverless car?

2012-06-06 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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: amazon interview questions

2012-06-06 Thread Ashish Goel
. O(n2) actually in worst case. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 6, 2012 at 12:52 PM, atul anand atul.87fri...@gmail.com wrote: nope geke is valid string.. here is the link from where question was taken http

Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
be done while forming the suffix trie Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 12:28 AM, Abhishek Sharma abhi120...@gmail.comwrote: I think it can be done by modifying the h-array and by making some changes in KMP

Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote: for -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: amazon interview questions

2012-06-05 Thread Ashish Goel
-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081

Re: [algogeeks] Re: interview HARD problem

2012-06-05 Thread Ashish Goel
yes, but this rectangle clause is troubling me... Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 3:18 PM, rafi rafiwie...@gmail.com wrote: you mean like scramble ? On Jun 5, 5:39 am, Ashish Goel ashg...@gmail.com wrote

[algogeeks] interview HARD problem

2012-06-04 Thread Ashish Goel
Given a dictionary of millions of words, give an algorithm to find the largest possible rectangle of letter that every row forms a word(reading left to right) and every column forms a word(reading from top to bottom). Best Regards Ashish Goel Think positive and find fuel in failure +919985813081

Re: [algogeeks] interview HARD problem

2012-06-04 Thread Ashish Goel
preparing a sample itself is a great problem here, that is why i called it hard all words in the rectangle horizontally as well as vertically needs to be valid dictionary words Ashish Hassan say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary words, indeed

RE: [algogeeks] MS Question: WAP to find files in a

2012-06-03 Thread Ashish Goel
] MS Question: WAP to find files in a directory/subdirectories i wrote this program in college labbut used shell script to simulate ls -r functionality. now to do in c or java .. we only need to knw about the libraries to use. On 6/3/12, Ashish Goel ashg...@gmail.com wrote: ls-r implementation

[algogeeks] MS Question: WAP to find files in a directory/subdirectories

2012-06-02 Thread Ashish Goel
ls-r implementation needed... Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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] Amazon : exponentiation(x,n)

2012-05-31 Thread Ashish Goel
the return type is int, hence when xpowern becomes bigger than INT_MAX, it should throw an exception. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 31, 2012 at 11:59 AM, Amol Sharma amolsharm...@gmail.comwrote: i didn't got your

[algogeeks] MS Question: Delete a node in single linked list if it is less than any of the successor nodes

2012-05-31 Thread Ashish Goel
; if (pCurr-data pRest-data) { if (pPrev) { pPrev-next = pRest; }; free(pCurr); } else { pCurr-next = pRest; } return pCurr; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed

Re: [algogeeks] MS Question: Delete a node in single linked list if it is less than any of the successor nodes

2012-05-31 Thread Ashish Goel
yes Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 31, 2012 at 2:34 PM, atul anand atul.87fri...@gmail.com wrote: @Ashish : please clarify this ques... delete a node in SLL if it is less than *any* of the succesor node .. 1 2 8 10

Re: [algogeeks] MS Question: Delete a node in single linked list if it is less than any of the successor nodes

2012-05-31 Thread Ashish Goel
that is what i have done by using recursion=stack. my code has problem, after free(pCurr);, i should have return pRest; Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 31, 2012 at 4:37 PM, atul anand atul.87fri...@gmail.com wrote

[algogeeks] Amazon : exponentiation(x,n)

2012-05-30 Thread Ashish Goel
=1; /*n will be odd here always*/ } return expo; } this is utilizing the fact that n is a binary number and can be written as x*xE when odd or xE otherwise. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you

Re: [algogeeks] Re: Tree/Graph implementation

2012-05-29 Thread Ashish Goel
Gene: why do you say that adjacency list is not a good solution for sparse matrix? what other alternates are you looking at? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, May 29, 2012 at 9:09 PM, Gene gene.ress...@gmail.com wrote: I'm

[algogeeks] problem with increment operator

2012-05-29 Thread ashish pant
#includestdio.h int main() { int a=4; printf(%d\n,++a + ++a + a++); return 0; } according to me output should be 17, but it is coming out to be 18. plz explain it?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

Re: [algogeeks] classic problem to tree to circular doubly linked list

2012-05-28 Thread Ashish Goel
= pleftDLL-left; pRoot-right= pLeftDLL; pLeftDLL-left = pRoot; //now join pLeftDLL and pRightDLL; struct node* pTemp = pRightDLL-left; pLeftDLL-left-right = pRightDLL; pRightDLL-left = pLeftDLL-left; pTemp-right = pLeftDLL; pLeftDLL-left = pTemp; return pLeftDLL; } Best Regards Ashish

Re: [algogeeks] Re: MS question : string compression

2012-05-27 Thread Ashish Goel
Will fail for the sing having say 257characters all same Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sat, May 26, 2012 at 12:26 PM, Navin Gupta navin.nit...@gmail.comwrote: This is called Run-Length-Encoding (RLE) of a string. Its purpose

Re: [algogeeks] Re: MS question : string compression

2012-05-26 Thread Ashish Goel
http://michael.dipperstein.com/rle/index.html and basic one is http://www.fileformat.info/mirror/egff/ch09_03.htm Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sat, May 26, 2012 at 1:10 PM, Hassan Monfared hmonfa...@gmail.comwrote: 1- try

[algogeeks] Amazon Q: Implement an algorithm to do wild card string matching

2012-05-26 Thread Ashish Goel
Implement an algorithm to do wild card string matching Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Amazon Q : Design a logWritter for server kind of application

2012-05-26 Thread Ashish Goel
Design a logWritter for server kind of application Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

[algogeeks] # of paths betweek two nodes in a DAG

2012-05-24 Thread Ashish Goel
My bad, i am not able to conceptualize this known problem, can anyone help Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Amazon interview question

2012-05-24 Thread Ashish Goel
too. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 24, 2012 at 4:51 PM, Aman Raj amanka...@gmail.com wrote: array of bits? if the current integer is present set the bit if else make it zero, searching, insertion and deletion all in O

Re: [algogeeks] Amazon interview question

2012-05-24 Thread Ashish Goel
refer http://www.cs.bell-labs.com/cm/cs/pearls/sol01.html Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 24, 2012 at 6:00 PM, Ashish Goel ashg...@gmail.com wrote: What is the purpose of these numbers, if the idea is to manage a free

Re: [algogeeks] MS Q

2012-05-22 Thread Ashish Goel
); } } } return result; } int _tmain(int argc, _TCHAR* argv[]) { int result=countIslands(); return 0; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jan 10, 2012 at 1:17 PM, Ashish Goel ashg...@gmail.com wrote: http://www.janaganamana.net

[algogeeks] Google Q : all anagrams next to each other

2012-05-22 Thread Ashish Goel
of all lists of this multimap to give all anagrams. Is there any other better solution for this problem? Can this be done *inplace*? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google

[algogeeks] Google Q: longest word made of subwords within the list

2012-05-22 Thread Ashish Goel
write a program to find the longest word made of other words. For instance, If my file has the following words (sorted): test tester testertest testing testingtester The longest word should be testingtester. Trie is the solution, what is the best Order possible? Best Regards Ashish Goel Think

Re: [algogeeks] Re: Amazon Question

2012-05-21 Thread Ashish Goel
Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, May 21, 2012 at 12:54 PM, sivaviknesh sivavikne...@gmail.comwrote: For this the cousins of 1 should be 9 8 12 13 14 15 how then can it be a 2 pass algorithm... we should also consider great

Re: [algogeeks] Re: Amazon Question

2012-05-21 Thread Ashish Goel
) firstCousins.add(pUncle-left-data); if (pUncle-right) firstCousins.add(pUncle-right-data); return true; } Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, May 21, 2012 at 5:41 PM, Ashish Goel ashg...@gmail.com wrote: For this the cousins of 1

Re: [algogeeks] Re: Microsoft interview question

2012-05-21 Thread Ashish Goel
return true. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, May 21, 2012 at 6:14 PM, Dave dave_and_da...@juno.com wrote: @Piyush: Did you even try this on any examples? If not, try a = {0,1,2,3} and b = {0,2,2,2}. Dave On Sunday, May 20

Re: [algogeeks] Re: Microsoft interview question

2012-05-21 Thread Ashish Goel
constant space vs no additional space and then O(n) time complexity not possible.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, May 21, 2012 at 8:01 PM, Dave dave_and_da...@juno.com wrote: @Ashish: Using a hash table violates the O(1

Re: [algogeeks] Re: Algo for Search in a 2D Matrix

2012-05-20 Thread Ashish Goel
i could not understand the Order Analysis of the solution ..is it k*(lg n)(lg m) or k*lg(mn) Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, May 20, 2012 at 11:15 PM, Anika Jain anika.jai...@gmail.com wrote: @ashish: ya m sorry.. i didnt

Re: [algogeeks] Print longest string duplicated M times

2012-05-20 Thread Ashish Goel
soln pls Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, May 20, 2012 at 5:49 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote: I can give you a dynamic programming approach in O(n^2) and O(n) space . On Tue, May 15, 2012 at 12:22 PM

  1   2   3   4   5   >