[algogeeks] Help solving this problem

2015-11-27 Thread mohit choudhary
Given an undirected graph G = (V, E), for any subset of nodes S ⊆ V we can construct a graph Gs from G by removing all nodes in S together with their incident edges. In the critical node problem (CNP), we are given an integer 1 ≤ k ≤ |V | and need to find a subset S of size k such that the graph

Re: [algogeeks] Re: can we check a number has last digit 5 or not using bitwise operator.

2012-10-11 Thread mohit mishra
@ Dev Thanx. On Thu, Oct 11, 2012 at 1:25 AM, Dave dave_and_da...@juno.com wrote: @Mohit: The decimal representation of a number ends in 5 if its low order bit is 1 and it is divisibile by 5. An algorithm using bitwise operations to check for divisibility by 5 is given at https

[algogeeks] can we check a number has last digit 5 or not using bitwise operator.

2012-10-10 Thread mohit mishra
-- 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

Re: [algogeeks] Number of arrangements

2012-09-07 Thread mohit mishra
I think answer would be 6C3*3!. ie 120. On Fri, Sep 7, 2012 at 10:20 AM, Navin Kumar algorithm.i...@gmail.comwrote: @tendua: Answer will be 6C3 x 3! . For example: If 5 letters are given then you can get only 10 combination of different letter = 5C3 ABC ABD ABE BCD BCE CDE ACD ACE

[algogeeks] Re: Search an element in a sorted and pivoted array

2012-08-29 Thread mohit
1.) Find the pivot point. to find pivot – for a sorted (in increasing order) and pivoted array, pivot element is the only only element for which next element to it is smaller than it. 2.) divide the array into two subarray and apply binary search. for calling binary search in two subarray - if

Re: [algogeeks] direct i online round

2012-08-20 Thread mohit choudhary
Scan first array check repeated values as in example( rt_triangle(4, {0, -1, -1, 1}, {1, -2, 1, -2})) -1,-1 is repeated twice at indices in array respectively 1and 2. now in second y-axis array check values at indices given by first array (in above example these values are -2 and 1 respectively)

[algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread mohit
here are the steps : 1) Construct a temporary array left[] such that left[i] contains product of all elements on left of A[i] excluding A[i]. 2) Construct another temporary array right[] such that right[i] contains product of all elements on on right of A[i] excluding A[i]. 3) To get OUT[],

[algogeeks] Re: MICROSOFT QUESTION

2012-08-16 Thread mohit
yeah we can do it without using an extra array too. first calculating the product of elements on its left and putting in OUT[] and then multiplying with the product of elements on its right . no auxiliary space used. On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote: Hi,

[algogeeks] Re: Microsoft Interview Question

2012-06-29 Thread mohit
+1 naveen On Thursday, June 28, 2012 8:29:26 PM UTC+5:30, Navin Gupta wrote: Keep two pointers - one at start of the array and other at end of the array Now current points to start of the array If current is negative , increment current If current is positive , swap it with the element

Re: [algogeeks] Is max distance between two leaves(diameter) in a tree is equal to max distance between any two node in that tree??

2012-06-25 Thread Mohit Khanna
What would be the diameter in case of a left skewed or right skewed tree? On Mon, Jun 25, 2012 at 12:48 PM, atul anand atul.87fri...@gmail.comwrote: consider a case where tree is right skewed or left skewed , in dat case max distance b/w two node found are root and leftmost or rightmost

[algogeeks] Amazon Interview Question

2012-06-14 Thread Mohit Rathi
Hi, *There are two arrays of length 100 each. Each of these has initially n (n=100) elements. First array contains names and the second array contains numbers such that ith name in array1 corresponds to ith number in array2. Write a program which asks the user to enter a name, finds it in

Re: [algogeeks] Amazon Interview Question

2012-06-14 Thread Mohit Rathi
...@gmail.comwrote: example pls... On Thu, Jun 14, 2012 at 1:01 PM, Mohit Rathi mohit08...@iiitd.ac.inwrote: Hi, *There are two arrays of length 100 each. Each of these has initially n (n=100) elements. First array contains names and the second array contains numbers such that ith name in array1

Re: [algogeeks] Differentiate the following declarations.

2012-06-06 Thread mohit mishra
In const char *a; and char const *a;both represent the same thing. i.e. the string whose address is store in pointer a is not changeable,but the pointer a can store address of another string if const char *a =Hello; /*string is fixed pointer is not*/ then *a='A';/*Error*/ a=Hi;

Re: [algogeeks] Datastructure and algorithms book

2012-06-05 Thread mohit mishra
Introduction To Algorithms By Clifford Stein, Thomas H Cormen, Ronald L Rivest, Charles E Leiserson On Tue, Jun 5, 2012 at 12:32 PM, arun prakash arunslb...@gmail.com wrote: Can anyone pls mail me good datastrucutre and algo books..or any link to download those books..thanks in advance

Re: [algogeeks] Recursion and Rooted Binary Trees

2012-05-02 Thread mohit mishra
just check first for the right child of node if (right*[**x**]** ≠* NIL ) and then first call print method for right child Algorithm 3 Print(x) 1: if (*x **≠* NIL) then 2: print *colour **[**x**]* 3: if (right*[**x**]** ≠* NIL) then 4: Print (right*[**x**]**)* 5:

Re: [algogeeks] thanx to all

2012-02-28 Thread mohit mishra
congrats :-) On Wed, Feb 29, 2012 at 10:56 AM, shady sinv...@gmail.com wrote: congrats :) keep participating and keep learning. On Wed, Feb 29, 2012 at 9:19 AM, atul anand atul.87fri...@gmail.comwrote: congo :) On Wed, Feb 29, 2012 at 5:30 AM, Varun Nagpal varun.nagp...@gmail.comwrote:

Re: [algogeeks] NIT Kurukshetra presents Online programming contest- ENCODER

2012-02-22 Thread Mohit Goel
check it now ... register your team and engage in codewar .. -- 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: convert into palindrome

2011-12-15 Thread Mohit kumar lal
...@gmail.com wrote: @Mohit Suppose for example String: NITAN LCS(Longest Common Subsequence) : NIN How do you get the palindrome with it? On Dec 15, 3:47 am, Lucifer sourabhd2...@gmail.com wrote: @Mohit I think what he meant is 2* strlen(Input

Re: [algogeeks] convert into palindrome

2011-12-14 Thread Mohit kumar lal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar...@yahoo.com rit2009...@iiita.ac.in http://profile.iiita.ac.in/rit2009014

Re: [algogeeks] Sub-array problem

2011-11-29 Thread Mohit kumar lal
such algo? On Tue, Nov 29, 2011 at 2:55 AM, Mohit kumar lal kumarmohit...@gmail.comwrote: Given a array of positive integers ,You have to find the largest sum possible from consecutive sub-array but sum should be less than or equal to K and also find that sub-array. Ex- array={2,1,3,4,5} k

[algogeeks] Sub-array problem

2011-11-28 Thread Mohit kumar lal
it by DP but complexity were same ( O(n^2)) so plz try to provide a solution for O(nlgn) or O(n). -- Mohit kumar lal IIIT ALLAHABAD -- 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] Re: Median of 2D matrix

2011-11-06 Thread mohit verma
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- 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: Re: Re: [algogeeks] Re: Modular arithmetic + Combinatorics

2011-11-05 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- You received this message because you are subscribed

Re: Re: Re: [algogeeks] Re: Modular arithmetic + Combinatorics

2011-11-05 Thread mohit verma
@ myself Dave's solution works fine. I should have close look at it. On Sat, Nov 5, 2011 at 12:17 PM, mohit verma mohit89m...@gmail.com wrote: @ Dave I think your solution wont work for the cases like (MAX_INT) C (MAX_INT-1). On Thu, Nov 3, 2011 at 10:20 PM, vaibhavmitta...@gmail.com

Re: [algogeeks] Re: Designing Data Structure

2011-11-05 Thread mohit verma
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- 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] Re: Binary tree to BST

2011-11-05 Thread mohit verma
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Social graph labeling

2011-11-04 Thread mohit verma
put some light on this topic? -- Mohit -- 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] Re: Median of 2D matrix

2011-11-04 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- You received

Re: [algogeeks] Dp solution for this problem?

2011-10-31 Thread mohit verma
need to consider the index of the array as the the vertices and the weigjht as the the value for the movement from the present vertex to it's connecting neighbour .. On 10/31/11, mohit verma mohit89m...@gmail.com wrote: Given a matrix you have to find the shortest path from one point

Re: [algogeeks] Re: Unique partition

2011-10-31 Thread mohit verma
For the array .. And for K=3 Ur algo will give (1 1 1) (1 1 1 ) (3 5 6) On 10/30/11, mohit verma mohit89m...@gmail.com wrote: sort the array : O(nlogn) keep an array/map containing frequency of each element in sorted array : O(n) v[n/k][k] - 2-D array of ints containing final partitions

Re: [algogeeks] Re: Unique partition

2011-10-31 Thread mohit verma
yeah , my algo wont work for these cases :(. On Mon, Oct 31, 2011 at 6:32 PM, sunny agrawal sunny816.i...@gmail.comwrote: @Mohit that will also not work example: {1,1,1,2,2,2,3,3,3} i think all the methods that try to fill the matrix(considering k sets as k rows) either horizontally

Re: [algogeeks] Dp solution for this problem?

2011-10-31 Thread mohit verma
thnx all On Mon, Oct 31, 2011 at 10:13 PM, Vandana Bachani vandana@gmail.comwrote: Hi Mohit, Bellman-Ford algorithm is a dynamic programming algorithm but u need it only if dijkstra's SP wont solve the problem... and Dijkstra's algo works only for +ve weights. So if u r sure

Re: [algogeeks] Re: What Data Structure to use ?

2011-10-31 Thread mohit verma
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- 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] Re: What Data Structure to use ?

2011-10-31 Thread mohit verma
@shashank , i agree. To reduce this overhead , we can implement prefix trie in bit-form or DAWG or lots of compression techniques are there at the cost of complex coding. On Tue, Nov 1, 2011 at 12:35 AM, WgpShashank shashank7andr...@gmail.comwrote: @Mohit Space Overhead Will be more if m,n

Re: [algogeeks] Re: Unique partition

2011-10-30 Thread mohit verma
. To unsubscribe 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. -- Mohit -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] Dp solution for this problem?

2011-10-30 Thread mohit verma
)--(1,1)---(2,2). Path cost - 5+3+2+1=11 I dont think some DP solution exist for this problem.Can it be? -- Mohit -- 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

Re: [algogeeks] Re: Modular arithmetic

2011-10-29 Thread mohit verma
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- 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] Re: Find all possible combination of integers for a given sum

2011-10-28 Thread mohit verma
ohh , the number can repeat itself. I dint notice that. On Fri, Oct 28, 2011 at 4:02 PM, mohit verma mohit89m...@gmail.com wrote: something like this : for(int i=0;temp=sum , isum/2;i++) { temp=temp-i; for(int j=i+1;jtemp;j++) couti j temp-j\n; } But there is a problem with code

Re: [algogeeks] Re: Find all possible combination of integers for a given sum

2011-10-28 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA

Re: [algogeeks] Re: Directi Questions - needed answers

2011-10-28 Thread mohit verma
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit -- 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] Intersection of arrays

2011-10-27 Thread mohit verma
. To unsubscribe 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. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: Find the later version

2011-10-12 Thread mohit verma
. To unsubscribe 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. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Qualcomm

2011-09-24 Thread mohit mittal
Hello yar, Please share the written paper format and interview questions. If dont want to display openly, plz share with my id mohitm.1...@gmail.com. It will be of great help to me. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this

[algogeeks] Queries regarding Summer(2012) internship

2011-09-23 Thread Mohit kumar lal
Hello everyone,. I am 3rd yr student from IIIT Allahabad,i want to know what companies I can apply for summer(2012) internship and what is the process for applying in these companies.My CGPI is around 8.Please reply as soon as possible. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread mohit verma
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Paypal

2011-09-10 Thread mohit mittal
Has anyone recently attended the placement procedure for paypal. Like how is it? -- 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/-/WzkQbuBpGlkJ. To post to

[algogeeks] Implementing a grep

2011-09-10 Thread mohit mittal
If i have to code the functioning of grep what data structure is recommended for implementing it. I was thinking may be using trie with each node having a vector list of line numbers in which they appear. Is it the correct one or is there any better solution to this. -- You received this

Re: [algogeeks] Paypal

2011-09-10 Thread mohit mittal
around 25th 65 arnd 8 -- 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/-/7FtN8hsesrgJ. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Re: Need algorithm asap

2011-09-07 Thread mohit verma
. To unsubscribe 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. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups

[algogeeks] os

2011-09-07 Thread Mohit Goel
How many processes are created in this snippet? Main() { Fork(); Fork() fork () || fork (); Fork (); } -- 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] os

2011-09-07 Thread Mohit Goel
a. 15 b. 19 c. 21 d. 27 e. 31 these are the only options. -- 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] os

2011-09-07 Thread Mohit Goel
20 is not in option ..so 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] os

2011-09-07 Thread Mohit Goel
thnks everyone... -- 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

[algogeeks] explain the output..!!

2011-09-05 Thread Mohit Goel
1) #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 () { /* The powers of 10 */ int pot[] = { 0001,0010,0100,1000 }; int i;

Re: [algogeeks] explain the output..!!

2011-09-05 Thread Mohit Goel
got it ..!! thnks everyone -- 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

[algogeeks] determine error..!!

2011-09-05 Thread Mohit Goel
1) #include stdio.h #define PrintInt(expr) printf(%s : %d\n,#expr,(expr)) int max(int x, int y) { (x y) ? return x : return y; } int main () { int a = 10, b = 20; PrintInt(a); PrintInt(b); PrintInt(max(a,b)); } 2#include stdio.h void

Re: [algogeeks] MICROSOFT

2011-09-04 Thread mohit verma
this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- 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

Re: [algogeeks] MICROSOFT

2011-09-04 Thread mohit verma
it would be better if we insert values in array in while loop and then outside call makeheapk() and then return topheap(); this will reduce the heap making complexity. On Sun, Sep 4, 2011 at 2:29 PM, mohit verma mohit89m...@gmail.com wrote: int funkth(node *root,int k) { queuenode * q

Re: [algogeeks] Tejas networks

2011-09-04 Thread mohit verma
?hl=en. -- *MOHIT VERMA* -- 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

Re: [algogeeks] Re: character count in array

2011-09-04 Thread mohit verma
. 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 http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You

Re: [algogeeks] Re: Need algorithm asap

2011-09-03 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received

Re: [algogeeks] Re: Need algorithm asap

2011-09-03 Thread mohit verma
this line is unnecessary if(result[i]==1) continue; I think this algo is good enough. But any improvements? -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
Ohh my bad. the complexity should be O(nlogn) + O(mlogm) +O(m) = O(tlogt) where t=max(m,n) On Sat, Sep 3, 2011 at 11:46 PM, mohit verma mohit89m...@gmail.com wrote: create a binary search tree by scanning the whole array and if the value already exists increase count field in that node O(nlogn

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
, mohit verma mohit89m...@gmail.comwrote: Ohh my bad. the complexity should be O(nlogn) + O(mlogm) +O(m) = O(tlogt) where t=max(m,n) On Sat, Sep 3, 2011 at 11:46 PM, mohit verma mohit89m...@gmail.comwrote: create a binary search tree by scanning the whole array and if the value already exists

Re: [algogeeks] Amazon - Interview Qn

2011-08-31 Thread Mohit kumar lal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar...@yahoo.com rit2009...@iiita.ac.in http://profile.iiita.ac.in/rit2009014 -- You received

Re: [algogeeks] Amazon - Interview Qn

2011-08-31 Thread Mohit kumar lal
. To unsubscribe 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. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar...@yahoo.com

Re: [algogeeks] Amazon - Interview Qn

2011-08-31 Thread Mohit kumar lal
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar...@yahoo.com rit2009...@iiita.ac.in http://profile.iiita.ac.in/rit2009014 -- You received this message because

Re: [algogeeks] Amazon - Coding Round-2 Qn

2011-08-31 Thread mohit verma
. -- *MOHIT VERMA* -- 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] Re: finding duplicates

2011-08-31 Thread mohit verma
email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: finding duplicates

2011-08-31 Thread mohit verma
=O(nlog n) for random k. On Wed, Aug 31, 2011 at 9:15 PM, mohit verma mohit89m...@gmail.com wrote: @ dave- commplexity of radix sort is = O(n log n). so better use heap sort. On Wed, Aug 31, 2011 at 4:07 PM, Dave dave_and_da...@juno.com wrote: @Bharatkumar: You've tacitly assumed

Re: [algogeeks] graph

2011-08-31 Thread mohit verma
. -- *MOHIT VERMA* -- 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] Re: finding duplicates

2011-08-31 Thread mohit verma
Is anything specific about digits of numbers given in above question? If no then as i said Yeah coz we compare the radix part in radix sort , so can't say exactly we are comparing the numbers (but portion of it) On Wed, Aug 31, 2011 at 9:27 PM, Dave dave_and_da...@juno.com wrote: @Mohit

Re: [algogeeks] graph

2011-08-31 Thread mohit verma
@mac - yeah you were right. Normally we number the vertices and forget about their co-ordinates in programming :) -- 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] Re: finding duplicates

2011-08-31 Thread mohit verma
that is what i said in above post. By portion or radix i mean : digit if numbers are being sorted at radix 10. On Wed, Aug 31, 2011 at 9:43 PM, Dave dave_and_da...@juno.com wrote: @Mohit: As I said, a radix sort does not use data comparisons. It extracts digits from the sort keys and uses

[algogeeks] Let's see if U can find the bug...

2011-08-30 Thread Mohit Gupta
*1.* /* Print armstrong numbers from 1 to 500 */ /*1st version of prgrm: I am using pow function*/ #includestdio.h #includeconio.h #includemath.h int main() { int num=1,temp,sum,r; while(num=500){ sum=0; temp=num; while(temp){ r=temp%10; sum+=pow(r,3); temp/=10; }

Re: [algogeeks] Re: Given an array A[] and a integer num. Find four no.s in the array whose sum is equal to given num.

2011-08-28 Thread Mohit Goel
This code may also work .give any counter examples... #includeiostream using namespace std; void find_sum(int num,int k,int j,int b); void display(int i,int j); #define MAX 8 int res[4]; //array to store 4 numbers.. int arr[MAX]

Re: [algogeeks] algo ques

2011-08-28 Thread Mohit kumar lal
. 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 http://groups.google.com/group/algogeeks?hl=en. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact

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

2011-08-28 Thread mohit verma
. -- *MOHIT VERMA* -- 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] Re: Print tree like a tree

2011-08-28 Thread mohit verma
. -- *MOHIT VERMA* -- 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] Re: Print tree like a tree

2011-08-28 Thread mohit verma
7 8 2 4 2 1 3 9 Could someone pleases modify this solution to print tree in top-down fashion? On Sun, Aug 28, 2011 at 11:38 PM, Rishabbh A Dua duarish...@gmail.comwrote: mohit, wat if the tree is growing dynamically? On Sun, Aug 28, 2011 at 11:27 PM, mohit verma mohit89m

Re: [algogeeks] Re: Print tree like a tree

2011-08-28 Thread mohit verma
I think for that we need to re-traverse the tree - in first recursion counting the levels and second time printing values and spaces accordingly. On Sun, Aug 28, 2011 at 11:50 PM, mohit verma mohit89m...@gmail.com wrote: i 've already mentioned if number of levels is known. Well for dynamic

Re: [algogeeks] Re: Problem on overflow

2011-08-28 Thread mohit verma
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 http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received

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

2011-08-27 Thread Mohit kumar lal
@googlegroups.com. To unsubscribe 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. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar

[algogeeks] map problem

2011-08-24 Thread mohit verma
without using extra map? -- *MOHIT VERMA* -- 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

Re: [algogeeks] Re: map problem

2011-08-24 Thread mohit verma
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- 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] Re: Doublly link list

2011-08-24 Thread Mohit kumar lal
://groups.google.com/group/algogeeks?hl=en. -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 kumarmohit...@gmail.com mohitkumar...@yahoo.com rit2009...@iiita.ac.in http://profile.iiita.ac.in/rit2009014 -- You received this message because you are subscribed to the Google Groups

Re: Re: [algogeeks] Re: array question

2011-08-15 Thread mohit verma
from array 1 on array 2? overall complexity : O(nlogn) On 14 August 2011 18:46, mohit verma mohit89m...@gmail.com wrote: example: array 1 :: 1 2 3 4 5 6 7 8 9 10 15 array 2:: 23 34 56 13 15 57 432 348 On Sun, Aug 14, 2011 at 6:44 PM, shady sinv...@gmail.com wrote

[algogeeks] array question

2011-08-14 Thread mohit verma
given two arrays : with all distinct elements but one element in common. Find the common element in optimal time. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] array question

2011-08-14 Thread mohit verma
example: array 1 :: 1 2 3 4 5 6 7 8 9 10 15 array 2:: 23 34 56 13 15 57 432 348 On Sun, Aug 14, 2011 at 6:44 PM, shady sinv...@gmail.com wrote: meaning ? what is a common element ? example ??? On Sun, Aug 14, 2011 at 6:37 PM, mohit verma mohit89m...@gmail.comwrote

[algogeeks] how to find K most significant digit of a number..???

2011-08-13 Thread Mohit Goel
-- 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

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Mohit Goel
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 correct if wrong... -- You received this message because you are subscribed to the Google

Re: [algogeeks] Re: Problems on Linked List

2011-08-11 Thread mohit verma
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Design a concurrent hash table

2011-08-11 Thread mohit verma
. -- *MOHIT VERMA* -- 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

[algogeeks] Novell questions

2011-08-11 Thread mohit verma
Hey guys, can anyone post some written and interview question asked by Novell? -- *MOHIT VERMA* -- 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] Re: Microsoft written!!!

2011-08-10 Thread Mohit Goel
10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p);

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Mohit Goel
@muthu raj: it will also come out ,when loop condition will not be statisfied.i.e when 'p' is not the right child of its parent...in such a case it will not reach root .. in the ex given by u it will stop at 4 . -- You received this message because you are subscribed to the Google Groups

[algogeeks] constness in c++

2011-08-08 Thread mohit verma
? -- *MOHIT VERMA* -- 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] constness in c++

2011-08-08 Thread mohit verma
to an integer, which I think can be changed. See if the code I suggested still does the same as your version... On 8 August 2011 19:53, mohit verma mohit89m...@gmail.com wrote: In c++ int d=1; const int *const ptr = d; means ptr is const ptr to const object .So neither ptr nor d can be changed

Re: [algogeeks] constness in c++

2011-08-08 Thread mohit verma
got it.. thanks guys On Mon, Aug 8, 2011 at 8:00 PM, mohit verma mohit89m...@gmail.com wrote: No .. in this case it flags error. On Mon, Aug 8, 2011 at 7:58 PM, Dipankar Patro dip10c...@gmail.comwrote: does the answer still remain same if you do the following: const int d=1; const int

  1   2   >