[algogeeks] Amit shah Home Minister of India: Support Arnab Goswami, Maharashtra Government is Harassing him.

2020-10-23 Thread ankit . bhardwaj4
ition here: http://chng.it/mcCGQwPTjm Thanks! ankit -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. To

Re: [algogeeks] Re: how to convert JSONObject object to java object ??

2015-06-19 Thread Ankit Agarwal
not working any idea ?* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- *Ankit Agarwal* *Software Engineer* *Seller

[algogeeks] Job openings in Limetray

2015-02-12 Thread Ankit Agarwal
Hey there, Limetray has a lot of openings in its Delhi office. Following is the list of current positions. If anything interests you, please send your resume to h...@hyring.com with the position you want to apply for as subject.For example: LeadMobile@limetray in case you want to apply for Lead

Re: [algogeeks] Find longest consecutive subsequence

2014-03-16 Thread Ankit Sambyal
Use bitwise hashmap. On Thu, Jan 30, 2014 at 8:46 PM, Don dondod...@gmail.com wrote: No. If you start at any number in a sequence it will find the entire sequence. There is no need to start again at some other number in that sequence. Don On Wednesday, January 29, 2014 12:19:21 AM

Re: [algogeeks] kth smallest element in 2 sorted arrays

2013-06-16 Thread Ankit Sambyal
Maintain the invaraint : i + j = k -1 if B[j-1] A[i] B[j], then A[i] must be the kth smallest else if A[i-1] B[j] A[i], then B[j] must be the kth smallest If the above conditions are not satisfied, subdivide the arrays. On Thu, Jun 13, 2013 at 1:41 PM, sourabh jain wsour...@gmail.com

[algogeeks] UTF-8 encoding

2013-06-09 Thread Ankit Sambyal
Lets suppose there is a UTF8 encoding scheme. You have to check if a string is valid UTF8 or not. Just read the below given description. UTF-8 is a variable-length encoding of letters or runes. If the most significant bit of the first byte is 0, the letter is 1 byte long. Otherwise, its length is

Re: [algogeeks] least common ancestore bst

2013-06-05 Thread Ankit Sambyal
struct node { int data; struct node* left; struct node* right; }; struct node* newNode(int ); /* Function to find least comman ancestor of n1 and n2 */ int leastCommanAncestor(struct node* root, int n1, int n2) { /* If we have reached a leaf node then LCA doesn't exist If

Re: [algogeeks] Re: Highest reminder

2013-06-05 Thread Ankit Sambyal
Hi Ankit, If that is the case, I can very well say, 23 = 2 X 1 + 21 If you divide 23 by 11, remainder would be 1 and not 12. On Thu, May 30, 2013 at 1:16 PM, Ankit Agarwal ankuagarw...@gmail.comwrote: Hi, 23 = 11 X 1 + 12. Thus 12 would the highest remainder. Not 11 On Thu, May 30

Re: [algogeeks] Re: Highest reminder

2013-05-30 Thread Ankit Agarwal
. On Thu, May 30, 2013 at 10:16 AM, Sanjay Rajpal sanjay.raj...@live.inwrote: Hi Ankit, for 23, how can the remainder be 12 ? Can you elaborate more ? *Regards,* *Sanjay Kumar* *Software Engineer(Development)* *Winshuttle Softwares(India) Pvt. Ltd.* *Mobile +91-89012-36292, +91-80535

Re: [algogeeks] Re: Highest reminder

2013-05-29 Thread Ankit Sambyal
Hi Nikhil, Highest remainder can't be floor(n/2) - 1. If n = 11, highest remainder would be 5 when it is divided by 6, but your formula gives 4. On Mon, May 27, 2013 at 8:16 PM, Nikhil Kumar niksingha...@gmail.comwrote: Since we need to divide so the quotient should be at least 1, and we need

Re: [algogeeks] Re: Highest reminder

2013-05-29 Thread Ankit Agarwal
Hi, Number 23: = 11 * 1 + 12 Number/2 = 11.5 Number 17: = 9 * 1 + 8 Number/2 = 8.5 So, its neither floor(n/2) +- 1, nor ceil(n/2) +- 1 On Wed, May 29, 2013 at 2:19 PM, Ankit Sambyal ankitsambyal1...@gmail.comwrote: Hi Nikhil, Highest remainder can't be floor(n/2) - 1. If n = 11

Re: [algogeeks] Re: Highest reminder

2013-05-29 Thread Ankit Agarwal
) = 8 For n = 23, floor((23-1)/2) = 11 For n = 12, floor((12-1)/2) = floor(11/2) = floor(5.5) = 5. Etc. Dave On Wednesday, May 29, 2013 1:36:13 PM UTC-5, Ankit wrote: Hi, Number 23: = 11 * 1 + 12 Number/2 = 11.5 Number 17: = 9 * 1 + 8 Number/2 = 8.5 So, its neither floor(n/2

Re: [algogeeks] inplace merge of 2 sorted parts of an array

2013-05-26 Thread Ankit Agarwal
received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- *Ankit Agarwal* -- You received this message because you

Re: [algogeeks] Array of intergers with repeating elements

2013-05-12 Thread Ankit Sambyal
Are these n+1 elements range from 1 to n+1 ? On Wed, May 8, 2013 at 12:02 AM, MAC macatad...@gmail.com wrote: I was asked this in recent amazon onsite interview and asked o write code Given an Array of integers . N elements occur k times and one element occurs b times, in other words

Re: [algogeeks] Number of paths

2013-02-21 Thread kumar ankit
) as there are m rows so m 'D's' and n columns so n 'R's'. Now the problem is to find the number of strings of size m+n of only Rs and Ds such that it has exactly m Ds and n Rs. So the answer is (m+n) C n. On Thu, Feb 21, 2013 at 2:14 PM, kumar ankit k.anki...@gmail.com wrote: Well, (m+n) C (n

Re: [algogeeks] Number of paths

2013-02-21 Thread kumar ankit
this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Kumar Ankit Senior

Re: [algogeeks] Amazon interview Question

2013-02-07 Thread kumar ankit
Navneet, For 2nd problem, i need a clarification, whether the Kth number is wrt mathematical ordering of numbers or the kth number is wrt to the order in which the number are input ? On Wed, Feb 6, 2013 at 10:00 AM, navneet singh gaur navneet.singhg...@gmail.com wrote: nice algo ankit, so

Re: [algogeeks] Amazon interview Question

2013-02-05 Thread kumar ankit
/opt_out. -- Kumar Ankit Senior Undergraduate Department of Computer Engineering Institute of Technology Banaras Hindu University Varanasi Ph: +91 9473629892 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group

[algogeeks] Dutch National Flag Algorithm

2013-01-15 Thread Ankit Tripathi
Hello everyone, Recently I encountered following program : Given an integer array of n elements ( where n is a multiple of 3 ), example : *a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4*. You have to rearrange the array in such a manner that the elements of array becomes : *a1, b1, c1, a2, b2,

[algogeeks] Re: Resources for understanding Dynamic programming

2012-11-17 Thread Ankit Tripathi
One of the best material related to algorithms as well as dynamic programming is the lecture notes by Jeff Erickson sir, you can check it out in the following link : http://www.cs.uiuc.edu/~jeffe/teaching/algorithms/ --

Re: [algogeeks] Check if a binary tree is Binary Search Tree or not.

2012-11-06 Thread Ankit Tripathi
I totally agree with atul007. And that's optimal because one must check every node for checking whether the tree is a BST or not, and this algorithm visits each node exactly once. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this

[algogeeks] Re: Informatica written que : C output

2012-10-31 Thread Ankit Tripathi
I would also like to add up something related to this context. One can use *fprintf* and set the *1st argument to 2*, *which stands for stderr*, ie., the standard error stream. stderr is defined in *stdio.h* header. The classic thing about stderr is that, by default it does not buffers any

[algogeeks] Re: C Macro

2012-10-30 Thread Ankit Tripathi
Besides i prefer to write the following #define which is generic and works in all case, i.e., it doesn't matter whether you pass pointers, float, int, etc; *#define swap( a, b )size_t t; t = a; a = b; b = t;* 1 more thing now you don't have to pass any other information i.e., whether your

[algogeeks] Re: Complicated declaration C

2012-10-30 Thread Ankit Tripathi
Your interpretation is right, i.e., the second argument returns an int. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/6iB_TkYbdUYJ. To post to this group,

Re: [algogeeks] Re: Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-27 Thread Ankit Singh
: @Ankit: Apply Lucas' Theorem, which you can find written up in Wikipedia. Dave On Sunday, August 26, 2012 3:57:18 PM UTC-5, Ankit Singh wrote: In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom nk

[algogeeks] Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-26 Thread Ankit Singh
In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom nk]denotes the number of ways of choosing k objects from n different objects. However when n and k are too large, we often save them after modulo

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
is output is depend on no of digits in a number like 123 example for odd no of digits and 121224 example for even digits??? can you make it clear pls?? On Sat, Aug 11, 2012 at 5:22 PM, payal gupta gpt.pa...@gmail.com wrote: Given the start and an ending integer as user input, generate all

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
if i am correctly understand the problem den i hv attchd the solution.. On Sun, Aug 12, 2012 at 12:40 AM, Ankit Singh ask9092516...@gmail.comwrote: is output is depend on no of digits in a number like 123 example for odd no of digits and 121224 example for even digits??? can you make

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
, 2012 at 12:44 AM, Ankit Singh ask9092516...@gmail.comwrote: if i am correctly understand the problem den i hv attchd the solution.. On Sun, Aug 12, 2012 at 12:40 AM, Ankit Singh ask9092516...@gmail.comwrote: is output is depend on no of digits in a number like 123 example for odd

Re: [algogeeks] Re: MS Q

2012-07-11 Thread ANKIT BHARDWAJ
anybody have informaton regarding questions asked in written and interview of capillary technology for developer post please share at bhardwaj.ankit...@gmail.com thanks in advance. On 5/22/12, Navin.nitjsr navin.nit...@gmail.com wrote: If the matrix is 4-connected, we can use the same matrix.

[algogeeks] Re: Question asked in Amazon online test

2012-06-28 Thread ANKIT BHARDWAJ
get the right most zero and left most one if index of right most zero is less than the index of left most one ,the problem is solved other wise swap 0 and 1 and so on... i argue this will give minimum swaps... -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Microsoft Interview Question

2012-06-28 Thread ANKIT BHARDWAJ
keep swaping left most -ve and left most positive untill counter reaches at the end of array, can be done in o(n) no extra space required.. 3rd year manit bhopal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on

[algogeeks] LCA tutorial

2012-06-19 Thread Ankit Gupta
I was going through this tutorial http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor but i was not able to fully understand the O(N), O(1) algorithm for the restricted RMQ. They have converted the array into a new binary array and find a solution for this new

Re: [algogeeks] Re: Longest sequence of numbers with atmost diff K

2011-12-31 Thread ankit gupta
HNY 2012(IST) in between to all members and happy coding for 2012 may all your compilation produce ZERO errors On Sun, Jan 1, 2012 at 12:01 AM, Lucifer sourabhd2...@gmail.com wrote: @above Correction.. i can be = R... hence, which can be found as part of traversal.. Another addition: I

Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
apply MAXHEAPIFY on root ode and extract the root node -- 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: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
maxheapify is lg(n)..check coremen -- 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

Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
http://www.cse.iitk.ac.in/users/dsrkg/cs210/applets/sorting/heapSort/heapSort.html for reference -- 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: Sub-array problem

2011-12-01 Thread Ankit Sinha
0; } Complexity O(n) Cheers, Ankit Sinha On Thu, Dec 1, 2011 at 4:58 PM, sourabh sourabhd2...@gmail.com wrote: @atul... thanks dude for ur thorough screening of the algo and pointing out the mistakes... I think that's y its always said that until and unless we don't turn an algo to a working

Re: [algogeeks] Finding the repeated element

2011-11-23 Thread Ankit Sinha
Only possible best solution seems to be sorting the array using median selection algorithm ( a varient of quicksort) and then comparing to find the elements. Cheers, Ankit!!! On Thu, Nov 24, 2011 at 11:32 AM, kumar raja rajkumar.cs...@gmail.com wrote: In the given array all the elements occur

[algogeeks] Re: Binary tree to BST

2011-11-05 Thread ankit agarwal
I think it's the only way as you need to traverse the entire binary tree to do it. On Oct 31, 9:45 pm, Ankuj Gupta ankuj2...@gmail.com wrote: How to convert a Binary tree to BST ? Naive way is to create each node of  Binary tree one by one and keep on creating the BST. -- You received this

[algogeeks] Re: Median of 2D matrix

2011-11-04 Thread ankit agarwal
the diagonal and find the middle element, that will be the median. Thanks Ankit Agarwal On Nov 5, 1:29 am, Gene gene.ress...@gmail.com wrote: Here's an idea.  Say we pick any element P in the 2D array A and use it to fill in an N element array X as follows. j = N; for i = 1 to N do   while A(i, j

Re: [algogeeks] Re: constant

2011-10-05 Thread ankit sablok
take a look at this and this is exactly the reason why it works :) http://stackoverflow.com/questions/3801557/can-we-change-the-value-of-a-constant-through-pointers On Thu, Oct 6, 2011 at 9:55 AM, Raghav Garg rock.ragha...@gmail.com wrote: *it is perfectly working in turbo c. can anyone

Re: [algogeeks] Re: SAP!!

2011-10-01 Thread ankit gupta
DBMS questions.designing architecture stuffs using normalization etc..basic DS questions.DBMS is the most imp aspect prepare it well...good luck :) -- 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] Amazon Interview Question

2011-09-24 Thread Ankit Sinha
; i 9; i++) printf([%d], a[i]); system(PAUSE); return 0; } Please comment. Cheers, Ankit Sinha On Sat, Sep 24, 2011 at 4:10 PM, malay chakrabarti m1234...@gmail.com wrote: dutch national flag problem :) On Sat, Sep 24, 2011 at 3:45 PM, Dheeraj Sharma

[algogeeks] MS-IT

2011-09-21 Thread ankit arun
hi!! MS-IT is visiting our college. could anyone plz help me in knowing what kind of questions(interview) they asked/asking. Thanks in advance. Ankit Arun NIT Durgapur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion

Re: [algogeeks] Re: informatica pattern and question of interview

2011-09-14 Thread Ankit Agarwal
2 question numbers are (a1+1)*a2*a3... an = a1*a2*a3...an + a2*a3...an the first term is same... for second term is (a1*a2...an)/(a1) now we have to find max of ( ((a1*a2..an)/a1), (a1*a2...an)/a2) so the question of max becomes min of( a1, a2, a3... an) -- Ankit Agarwal Computer Science

Re: [algogeeks] Exchanging bit values in a number

2011-09-13 Thread Ankit Agarwal
let x = 2^j + 2 ^i new number after swapping the digits is x XOR n eg n = 1101 j = 6 i = 2 x = 0100 0100 new number = x XOR n = 0100 1001 -- Ankit Agarwal Computer Science Engg. Integrated Dual Degree, V yr Department of Electronics Computer Engineering Indian Institute of Technology

Re: [algogeeks] Facebook Interview questions. -- Urgent

2011-09-07 Thread Ankit Minglani
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- The more you sweat in the field, the less you bleed in war. Ankit Minglani NITK Surathkal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

[algogeeks] explain the putput of this program

2011-09-03 Thread Ankit Sablok
#includeiostream #includecstdio #includecctype #includecstdlib #includecstring using namespace std; int main() { int **h; int a[2][2]={1,2,3,4}; h= (int **)a; int i,j; printf(\n%d,*h); (*h)++; printf(\n%d,*h); getchar(); getchar(); return 0; } gives an output 1 and 5 why?

[algogeeks] Re: SEEK advice very urgent

2011-09-01 Thread ankit arun
@ raj which clg r u from? I would say btr to choose its branch in Singapore. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/eUlkIYwpzTgJ. To post to this

[algogeeks] Any ideas on project on data mining ??

2011-08-30 Thread Ankit Minglani
Any ideas on project on data mining ?? -- The more you sweat in the field, the less you bleed in war. Ankit Minglani NITK Surathkal -- 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] Algorithm to find two numbers in an array that sum up to a given number

2011-08-30 Thread Ankit Minglani
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- The more you sweat in the field, the less you bleed in war. Ankit Minglani NITK Surathkal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread ankit gupta
store inorder traversal in the array and while reconstructing form a tree around mid element using recursion... -- 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

Re: [algogeeks] String Reverse

2011-08-29 Thread Ankit Agarwal
void function(int start, int end){ if (start end) return; int x= a[end]-a[start]; a[start] = a[start] + x; a[end] = a[end] - x; function(start+1, end-1); } main(){ scanf(%s, a[0]); int len = strlen(a); function(0,len-1); printf(%s\n, a); } -- Ankit Agarwal

[algogeeks] Doubt regarding the escape sequences

2011-08-28 Thread ankit sablok
How can I store an escape sequence at each character of the string when i give the string as an input to the program? Can anybody suggest me something other than the method i mention below #includeiostream #includecstdio #includecstring using namespace std; int main() { char s[100];

Re: [algogeeks] array sum

2011-08-27 Thread Ankit Sinha
Algo: 1. Sort the array 2. modify binary search on the set comparing average of both the set. 3. if aveage (start, mid) average (mid , end) then go to left sub set else right subset. This could lead to solution in o(nlogn) time. Please comment futher!! Cheers, Ankit Sinha On Sat, Aug 27

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread ankit arun
: A book by 'Yashwant Kanetkar' On Fri, Aug 26, 2011 at 9:03 AM, Navneet navneetn...@gmail.com wrote: Ankit, i would also like to mention Mark Allan Weiss book on Data Structures. Available in both C and C++ (different books) On Aug 25, 3:59 pm, Abhishek mailatabhishekgu...@gmail.com

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread ankit arun
Ya sure... :) After posting it Igot even more confused... On Sat, Aug 27, 2011 at 9:33 AM, siddharth srivastava akssps...@gmail.comwrote: On 27 August 2011 08:48, ankit arun talk.ankit...@gmail.com wrote: thanks everybody for so many suggestions... :) so let us know when you finish all

[algogeeks] Suggestion

2011-08-25 Thread ankit arun
Plz suggest me a good book for Data structure in C. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/q93wVIu_W9IJ. To post to this group, send email to

[algogeeks] Re: My MORGAN STANLEY INTERVIEW Process

2011-08-24 Thread Ankit Minglani :)
. @shadyU seriously need to cool down dude... On Tue, Aug 23, 2011 at 4:09 PM, shady sinv...@gmail.com wrote: very good ... spammer On Tue, Aug 23, 2011 at 3:31 PM, Ankit Minglani ankit.mingl...@gmail.com wrote: Link To my MORGAN STANLEY INTERVIEW PROCESS http://adf.ly/2Qewl

Re: [algogeeks] Re: Find the non-duplicate element in sorted array in O(n) time

2011-08-24 Thread Ankit Minglani
://groups.google.com/group/algogeeks?hl=en. -- The more you sweat in the field, the less you bleed in war. Ankit Minglani NITK Surathkal -- 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

[algogeeks] Any body have idea about samsung india recruitment...

2011-08-18 Thread Ankit singh
hi, is there any1 who appeared for samsung india,i want to know what type of questions asked in the written test and interview.and please also tell that what was the eligibility criteria for written test.the company will be coming on 24 in our college. friends please reply... Ankit Singh IIITM

Re: [algogeeks] Re: Any body have idea about samsung india recruitment...

2011-08-18 Thread Ankit singh
thanks *Ankit Singh * On Thu, Aug 18, 2011 at 4:51 PM, DheerajSharma dheerajsharma1...@gmail.comwrote: samsung SISO would be coming day after tomm. in our collg..would tell u the details..howevel..samsung SEL visited..our collg few dayz..back..there was first an aptitude paper..having

[algogeeks] MS question

2011-08-14 Thread ankit sambyal
You have to make a package library which will do the calculation of (a^b)mod(c), where a, b, c are very large size of 1 digits. (^- power). Design a data structure for the numbers' storage and suggest what functions will you be providing to user with them. Also mention the advantages of using

[algogeeks] Re: Probability Puzzle

2011-08-14 Thread Ankit Gupta
A=p(biased coin/5 heads)=8/9 probability that the coin is biased given 5 heads (bayes theorem) B=p(unbiased coin/5 heads)=1/9 P(6th head)=A*1+B*1/2=17/18 -- 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] MS question

2011-08-14 Thread ankit sambyal
@sagar : What is the best answer for this question ?? -- 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] Adobe Interview Question

2011-08-13 Thread ankit tyagi
HI, for n=3 there are 4 possibility 1 _123_ 2 _13_ 2 _23_ 4 _2_ but according to kamakshi it should be 3. please explain On Sat, Aug 13, 2011 at 11:05 PM, Piyush Kapoor pkjee2...@gmail.com wrote: what does step refer to in this case??? Please explain the example... On Sat, Aug 13,

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread ankit tyagi
seems fine.. On Sun, Aug 14, 2011 at 12:13 AM, Mohit Goel mohitgoel291...@gmail.comwrote: there are 5 possibilities ..5th one is_12_..other as specified by ankit... t(1) =2 (it can directly jump to anathor bank) t(2) =3 ( _2_,_1_,_12_) t(3) =5... thats how fibonnaci goes on plz

Re: [algogeeks] Remove spaces

2011-08-12 Thread ankit sambyal
void delExtraSpaces (char *Str) { int Pntr = 0; int Dest = 0; int flag=0; while (Str [Pntr]) { if (Str [Pntr] != ' ') { Str [Dest++] = Str [Pntr]; flag=0; } else if(Str[Ptr]==' ' flag==1) Str [Dest++] = Str [Pntr]; else flag=1; Pntr++; } Str [Pntr] = '/0'; } --

Re: [algogeeks] Remove spaces

2011-08-12 Thread ankit sambyal
Guys sorry for posting the buggy code . Here is the working code : void delExtraSpaces (char Str[]) { int Pntr = 0; int Dest = 0; int flag=0; while (Str[Pntr]!='\0') { if (Str[Pntr] != ' ') { Str[Dest++] = Str[Pntr]; flag=0; } else if(Str[Pntr]==' ' flag==0) { Str[Dest++] =

Re: [algogeeks] Re: Amazon question.

2011-08-10 Thread ankit sambyal
@kunal, anuj : step 2 of my algo takes O(n^2). So how can the TC be O(nlogn) -- 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] Problems on Linked List

2011-08-10 Thread ankit sambyal
Ques 1: Let l1 and l2 be the 2 lists. Step 1 : Reverse l1 O(n) Step 2 : Compare l1 and l2 by comparing each node and traversing ahead.--O(n) Step 3: Reverse l1 -O(n) Ques 2: Let cur be the node of the linked list which is to be

Re: [algogeeks] problem regarding output??

2011-08-09 Thread ankit sambyal
its because void pointer is incremented by 1, when we do k++ whereas integer pointer is incremented by 4, when we do j++ -- 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] problem regarding output??

2011-08-09 Thread ankit sambyal
The typecasting tells the compiler that the void pointer is now pointing to an integer and when we use this pointer to access the integer it takes value from 4 bytes. But when we try to increment that pointer, it will point to the next byte. Try taking k as pointer to double instead of void, u

[algogeeks] MS question

2011-08-09 Thread ankit sambyal
Given an array of characters, change the array to something as shown in the following example. Given : ddbbccae O/P : 2d4a2b2c1a1e Do it in the most efficient manner both in terms of time and space ... -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] MS question

2011-08-09 Thread ankit sambyal
@shady : I think there is a catch in that approach. Plz post ur code -- 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] MS question

2011-08-09 Thread ankit sambyal
@raghavan: ur approach uses O(n) space -- 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

Re: [algogeeks] MS question

2011-08-09 Thread ankit sambyal
@sagar: for abcd, ur pgm gives abcd. I was trying a pgm which gives 1a1b1c1d. But now i think this problem is wrong, because in this case it exceeds the size of the array if we try to o/p as 1a1b1c1d. Hence we require a new array for it. -- You received this message because you are subscribed to

Re: [algogeeks] MS question

2011-08-09 Thread ankit sambyal
ya got it now. I misunderstood the question -- 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.

Re: [algogeeks] Amazon question.

2011-08-09 Thread ankit sambyal
1. Square each element of the array and then sort it---O(nlogn) 2. for(i=0;i(size-3);i++) { j=i+1; k=size-1; while(jk) { if(a[[i] + a[j] == a[k]) printf(\n%d %d %d,sqrt(a[i]),sqrt(a[j]),sqrt(a[k])); else if(a[i] + a[j] a[k]) j++;

Re: [algogeeks] mcq

2011-08-08 Thread ankit sambyal
C -- 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 group at

[algogeeks] Amazon Question

2011-08-08 Thread ankit sambyal
Plz give the answers ... 1. In a binary max heap containing n numbers, the smallest element can be found in time ?? 2. The number of total nodes in a complete balanced binary tree with n levels is, a)3^n + 1 b)2^(n+1) - 1 c) 2^n + 1 d) none of above 3. In a country where everyone wants

Re: [algogeeks] Re: amazon question

2011-08-08 Thread ankit sambyal
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 the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this

Re: [algogeeks] amazon question

2011-08-08 Thread ankit sambyal
@aditi : the ans is 3. Why do u think there is no definite ans ? -- 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] Doubts

2011-08-08 Thread ankit sambyal
@aditya : can u explain how u got c part as the answer for question 2 -- 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] MS test

2011-08-07 Thread ankit sambyal
@programming love : 6.5 can be represented accurately in binary -- 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] MS test

2011-08-07 Thread ankit sambyal
@programming love : 0.1 can't be represented accurately in binary. If u try to convert it into binary, it will not terminate. Try it !! But 6.5 can be converted. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Sum from array

2011-08-07 Thread ankit sambyal
@swetha: This problem can't be solved in O(n) -- 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] MICROSOFT INTERVIEW QUESTIONS faced by my frenz nd me

2011-08-07 Thread ankit sambyal
Can anybdy explain the following questions : (5) Find the output int arr[2][3]={{1,2,3},{4,5,6}}; int (*ptr)[3]=a[0]; printf((%d,%d),(*ptr)[1],(*ptr)[2]); ptr+=1; printf((%d,%d),(*ptr)[1],(*ptr)[2]); Will this program compile properly or will end in segmentation fault ?? (9) Given a inorder

Re: [algogeeks] amazon

2011-08-07 Thread ankit sambyal
bubble sort -- 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

Re: [algogeeks] Probability Puzzle

2011-08-07 Thread ankit sambyal
17/80 On Sun, Aug 7, 2011 at 10:34 AM, Algo Lover algolear...@gmail.com wrote: A bag contains 5 coins. Four of them are fair and one has heads on both sides. You randomly pulled one coin from the bag and tossed it 5 times, heads turned up all five times. What is the probability that you

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

2011-08-07 Thread ankit sambyal
@coder : Cud u plz explain the approach for question 9 ?? -- 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: probablity

2011-08-07 Thread ankit sambyal
the answer is 1/2 -- 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

Re: [algogeeks] OUTPUT????

2011-08-06 Thread Ankit Minglani
from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- The more you sweat in the field, the less you bleed in war. Ankit Minglani NITK Surathkal -- You received this message because you

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread ankit sambyal
Is there any time limit for the questions in amazon online test ? I mean shud we write efficient code or shud we just make our pgm rum ? -- 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] MS test

2011-08-06 Thread ankit sambyal
4. a 6 b -- 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 group

Re: [algogeeks] MS test

2011-08-06 Thread ankit sambyal
the code given in question 5 should not terminate because of the condition of the for loop -- 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 test

2011-08-06 Thread ankit sambyal
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 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] MS test

2011-08-06 Thread ankit sambyal
@sukran: 40%of work i.e. 120 sec of work is sequential and can't be distributed among multiple processors. Since we hv to complete the work in 150 sec, so we r left with 30 sec. Remaining 60% work=180sec. 180/30=6 So we require 5 additional processors -- You received this message because you

Re: [algogeeks] MS test

2011-08-06 Thread ankit sambyal
@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 post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

  1   2   3   4   >