Re: [algogeeks] Need help

2018-04-22 Thread Saurabh Paliwal
roup and stop receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks&quo

Re: [algogeeks] Find all the subarrays in a given array with sum=k

2016-03-23 Thread Saurabh Agrawal
Hi, This question was asked in Amazon interview few days back. Please explain to me the part after building the SUM array. With Regards, Saurabh Agrawal On Sun, Feb 21, 2016 at 9:08 PM, Saurabh Paliwal < saurabh.paliwa...@gmail.com> wrote: > Hi, > I can think of an approach tha

Re: [algogeeks] Find all the subarrays in a given array with sum=k

2016-02-21 Thread Saurabh Paliwal
4 -11 3 4 8} > > You have to print {from index, to last index} so for above example {0, > 3}; {0,8}; {7,8} is the answer > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and

Re: [algogeeks] Openings in Mentor Graphics,Noida Location

2016-02-18 Thread Saurabh Agrawal
Hi, PFA. With Regards, Saurabh Agrawal On Tue, Nov 17, 2015 at 10:04 AM, Ashish kumar Jain <akjlucky4...@gmail.com> wrote: > 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. > >

Re: [algogeeks] Re: Find max sum of elements in an array ( with twist)

2016-01-12 Thread Saurabh Paliwal
least one of them to move forward). >> >> eg :- >> >> 10 , 20 , 30, -10 , -50 , 40 , -50, -1, -3 >> >> Output : 10+20+30-10+40-1 = 89 >> >> > -- > You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

Re: [algogeeks] Openings in Mentor Graphics,Noida Location

2015-11-16 Thread saurabh singh
Banned for spamming. Again a request to the members to post algorithm related queries. Stuck in some programming problem? Post it here. Not understanding some algorithm? Post it here. Found an interesting problem? Post it. On Tue, Nov 17, 2015 at 10:04 AM Ashish kumar Jain

Re: [algogeeks] Opening in Oracle IDC: Having experience in C/C++ 1.5 to 3 yr

2015-11-16 Thread saurabh singh
Banned for spamming. Again a request to the members to post algorithm related queries. Stuck in some programming problem? Post it here. Not understanding some algorithm? Post it here. Found an interesting problem? Post it On Mon, Nov 16, 2015 at 8:56 AM shashi kant wrote:

[algogeeks] Re: [BANNED!!!] Urgent need Lead - Java Developer in Atlanta, GA

2015-11-02 Thread saurabh singh
FYI, have banned this user and several others who mistook this group for a recruitment platform. Can we revive the legacy of this group again? On Mon, Nov 2, 2015 at 11:36 PM Shaik Asif wrote: > Hi Partner, > > This is Shaik from Deegit Inc. Partner find the below

Re: [algogeeks] Re: [BANNED!!!] Urgent need Lead - Java Developer in Atlanta, GA

2015-11-02 Thread saurabh singh
ndra A C <sachindr...@gmail.com> > wrote: > >> Well, you need to ban a whole lot more people. >> >> On Mon, Nov 2, 2015 at 10:16 AM, saurabh singh <saurab...@gmail.com> >> wrote: >> >>> FYI, have banned this user and several others who

RE: [algogeeks] Yo! Help me make a Music Video

2014-12-28 Thread saurabh singh
Nope. Forwarding this mail to a group with over 1 k members is definitely begging. It's shameless begging as it can get. No,Didn't bother to open the link. Also banning you from the group. -Original Message- From: Shrey Choudhary choudharyshre...@gmail.com Sent: ‎12/‎28/‎2014 4:52 PM

Re: [algogeeks] C++ initialization list

2014-09-28 Thread saurabh singh
specific thing. The language doesn't advocates it. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Sep 28, 2014 at 3:47 PM, sagar sindwani sindwani.sa...@gmail.com wrote: Thanks Deepak and Rahul for the reply. Do you guys have any standard document

Re: [algogeeks] DP problems

2014-06-05 Thread Saurabh Paliwal
from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop

Re: [algogeeks] DP problems

2014-06-05 Thread Saurabh Paliwal
, it did not work. But i think the brute force solution is possible in O(n^3) solution. We have O(n^2) combination of end points. we can check for the maximum possible even length palin string in O(n). So that will give O(n^3). Anyone has solution about O(n^2)? On 5 June 2014 22:25, Saurabh Paliwal

Re: [algogeeks] DP problems

2014-06-05 Thread Saurabh Paliwal
Ok! So I guess now we are talkng my solution. What i do is maintain two pointers i and j, i is the end of the first string and j is the beginning of the second. If both the character match, I calculate the answer for pointers i-1,j+1 and add 1 to the answer for i,j. If they don't match, I simply

Re: [algogeeks] DP problems

2014-06-05 Thread Saurabh Paliwal
by memoization. On Thu, Jun 5, 2014 at 11:37 PM, Saurabh Paliwal saurabh.paliwa...@gmail.com wrote: Ok! So I guess now we are talkng my solution. What i do is maintain two pointers i and j, i is the end of the first string and j is the beginning of the second. If both the character match, I

Re: [algogeeks] DP problems

2014-06-05 Thread Saurabh Paliwal
is the answer So time complexity = space complexity = O(n^2). Correct me if i am wrong On 5 June 2014 23:44, Saurabh Paliwal saurabh.paliwa...@gmail.com wrote: And now I get what you meant when you said palindrome. You should have explained that if that was not exact palindrome So yes

Re: [algogeeks] Solving equation

2014-01-27 Thread saurabh singh
^ No its not invalid. It just represents an equation with infinitely many correct solutions depending on the domain of x. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Mon, Jan 27, 2014 at 4:21 PM, Amol Sharma amolsharm...@gmail.com wrote: i din't get

Re: [algogeeks] Solving equation

2014-01-27 Thread Saurabh Paliwal
Ws On 27 Jan 2014 17:02, saurabh singh saurab...@gmail.com wrote: ^ No its not invalid. It just represents an equation with infinitely many correct solutions depending on the domain of x. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Mon, Jan 27

Re: [algogeeks] coloring problem Dynamic programming

2013-12-28 Thread Saurabh Paliwal
@atul your understanding of my recurrences are fine but of the question are not. You cannot have 3 adjacent houses with same colour. GGY is a fine case for this problem. On 28 Dec 2013 20:44, atul anand atul.87fri...@gmail.com wrote: @saurabh : i did not get your algo for modified ques i.e No 3

Re: [algogeeks] coloring problem Dynamic programming

2013-12-26 Thread Saurabh Paliwal
. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] coloring problem Dynamic programming

2013-12-16 Thread Saurabh Paliwal
, kumar raja rajkumar.cs...@gmail.com wrote: Saurabh your solutions seems right , but can u explain me how did u arrive at the time and space complexity with some proof /pseudocode/ explanation? On 15 December 2013 09:47, Saurabh Paliwal saurabh.paliwa...@gmail.comwrote: what is the issue

Re: [algogeeks] coloring problem Dynamic programming

2013-12-14 Thread Saurabh Paliwal
is minimized. Regards, Kumar Raja. -- 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. -- -Saurabh Paliwal

Re: [algogeeks] variation of LIS problem

2013-10-25 Thread Saurabh Paliwal
algo On 10/24/13, pankaj joshi joshi10...@gmail.com wrote: @Saurabh: As per the question the elements of sub-sequence should be increasing, so the solution will be {5} and as per the program. * but as written longest sub-sequence of k =2, so it should be {2,3} for this case

Re: [algogeeks] variation of LIS problem

2013-10-24 Thread Saurabh Paliwal
.87fri...@gmail.comwrote: @Saurabh Paliwal : yes On 10/24/13, Saurabh Paliwal saurabh.paliwa...@gmail.com wrote: Do you mean *of all the increasing subsequences of length k in this array, find the one with maximum sum ?* On Wed, Oct 23, 2013 at 10:52 PM, atul anand atul.87fri

Re: [algogeeks] variation of LIS problem

2013-10-24 Thread Saurabh Paliwal
check for {5,2,3} and K = 2. On Thu, Oct 24, 2013 at 7:41 PM, pankaj joshi joshi10...@gmail.com wrote: @ Saurabh, I have done a correction on algo temp =0 loop n to a[] if a[i]temp if min-heap(root) a[i] if min-heap(count)==k delete root in min- heap inseart

Re: [algogeeks] variation of LIS problem

2013-10-23 Thread Saurabh Paliwal
Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google

Re: [algogeeks] Need an optimized solution.

2013-10-20 Thread Saurabh Paliwal
I submitted the solution on hackerrank and got Accepted. There is a change though, there may be more terms like Term (r+1) but this can also be done using O(1). Term (r+2) : (2*n+1 - (r+2)*k)/2 and so forth until numerator becomes zero. You can use the same technique to get this sum as well.

Re: [algogeeks] Need an optimized solution.

2013-10-18 Thread Saurabh Paliwal
, Pankaj Kumar Joshi -- 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. -- -Saurabh Paliwal B-Tech. Comp

Re: [algogeeks] Need an optimized solution.

2013-10-18 Thread Saurabh Paliwal
there is a minor correction in definition of r, actually r is the maximum of all the numbers i such that *i*k-1=n.* On Fri, Oct 18, 2013 at 2:38 PM, Saurabh Paliwal saurabh.paliwa...@gmail.com wrote: I think I have an O(1) solution to this problem. I think we can use the idea of summing

Re: [algogeeks] Leaf nodes from inorder traversal

2013-03-16 Thread Saurabh Paliwal
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. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg

Re: [algogeeks] Re: Print tree node which sum

2013-03-08 Thread Saurabh Paliwal
. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- 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

Re: [algogeeks] Re: Print tree node which sum

2013-03-08 Thread Saurabh Paliwal
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. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you

Re: [algogeeks] Re: Algo Question

2013-02-26 Thread Saurabh Paliwal
emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google

Re: [algogeeks] Re: FInd unique element.

2013-02-22 Thread Saurabh Paliwal
...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from

Re: [algogeeks] Re: FInd unique element.

2013-02-22 Thread Saurabh Paliwal
...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from

[algogeeks] Re: CODECRACKER 2013 [codecracker.in]

2013-02-01 Thread saurabh araiyer
I apologise, the contest is from 11:00 PM IST to 2:00 AM IST On Fri, Feb 1, 2013 at 5:06 PM, saurabh araiyer siz...@gmail.com wrote: Hi, CodeCracker is an online programming contest with fully automated judge system. The main drive and motivation behind this platform is to inculcate

Re: [algogeeks] sortin 2D array

2013-01-08 Thread Saurabh Paliwal
the elements should be in sorted order. For example: for the above 2-D array, the output should be: A [ ] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 21, 22, 35, 40, 58 } -- -- -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE --

Re: [algogeeks] perfect square condition checking....

2012-12-27 Thread saurabh singh
Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Dec 23, 2012 at 9:07 PM, Anil Sharma anilsharmau...@gmail.comwrote: no matter how much large number is still,how large?If it fits in long long int then using binary search we can check this is O(log n

Re: [algogeeks] Regex tester

2012-12-23 Thread saurabh singh
If you need to implement this for some project then python and java have a very nice library Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Dec 23, 2012 at 7:48 PM, shady sinv...@gmail.com wrote: http://stackoverflow.com/questions/13144590

Re: [algogeeks] how does this code achieve SIGSEGV

2012-12-21 Thread Saurabh Paliwal
Allahabad B.Tech IT 4th Year Mob no: +91 9454992196 E-mail: rit2009...@iiita.ac.in jprakha...@gmail.com -- -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE --

Re: [algogeeks] how does this code achieve SIGSEGV

2012-12-21 Thread saurabh singh
segmentation fault. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Dec 22, 2012 at 10:52 AM, Saurabh Paliwal saurabh.paliwa...@gmail.com wrote: I am afraid both of you are incorrect.. 1. since the code modified by you will compile but give sigsegv

Re: [algogeeks] how does this code achieve SIGSEGV

2012-12-17 Thread Saurabh Paliwal
. -- -- -Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE --

Re: [algogeeks] Re: Adobe Interview Question

2012-12-13 Thread saurabh singh
^ *Exactly,* Things are the *same all around the globe *in terms of hiring procedure for programming positions. However I don't understand *this is India *part? Kindly reply only *when you think you are contributing something to the community.* Saurabh Singh B.Tech (Computer Science) MNNIT

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread saurabh singh
of permutations that begin with 0 from this number. Since any factorial in the denominator part will be less than or equal to (len)! we can calculate and store them while calculating len! Hence the overall operation will take O(len) time which would be O(log n) where n is the number. Saurabh Singh B.Tech

Re: [algogeeks] Adobe Interview Question

2012-12-11 Thread saurabh singh
routines. If he still disagreed I would have given him this solution: #includestdio.h int main() { int ch; while((ch=getchar())!=-1) putchar(ch); return 0; } Would have run this as *./a.out file_to_read* * * If he still disagreed I would have walked out :P Saurabh Singh B.Tech (Computer Science

Re: [algogeeks] Data structure and algorithm made easy by narasimha karumanchi

2012-12-06 Thread saurabh singh
itti achi hai to khareed lo jake..yaha na milegi :P ( If it is that good,go buy it.You won't get it here) *No more posts on this thread.And please this is not torrent. Please dont post such requests in future* Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com

Re: [algogeeks] VIDEO STREAMING

2012-11-24 Thread saurabh singh
has any idea about video streaming using vlcj lib ?? -- *WITH REGARDS, *KARTIK SACHAN B.Tech. Final Year Computer Science And Engineering Motilal Nehru National Institute of Technology,Allahabad Phone No: +91-9451012943 E-mail: kartik.sac...@gmail.com -- -- -- Saurabh

Re: [algogeeks] Re: Loan

2012-11-13 Thread saurabh arora
u contact indian embassy man..they will help u ,we are also poor with no money!! -- 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] Check if a binary tree is Binary Search Tree or not.

2012-11-09 Thread saurabh singh
Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Fri, Nov 9, 2012 at 10:00 AM, atul anand atul.87fri...@gmail.com wrote: @saurabh : correct..yes if you are considering recursive approach , so it will take O(n) space stack.But same can be done using

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

2012-11-08 Thread saurabh singh
^ To perform inorder traversal in a binary tree without using stack space the tree must be mutable. In other cases as far as I can think the space complexity should be asymptotically O(n) where n are the number of nodes. Saurabh Singh B.Tech (Computer Science) MNNIT

Re: [algogeeks] Re: Repeated values

2012-11-06 Thread Saurabh Kumar
yes, that was an implementation mistake but what I meant to say was- Adding extra check of indirect xor'ing could have a pitfall too. Try the case: [0 1 1 1 4 4] http://ideone.com/3sreLZ On 4 November 2012 10:13, Vikram Pradhan vpradha...@gmail.com wrote: It should have caught in the first

Re: [algogeeks] Ternary operators

2012-11-02 Thread Saurabh Kumar
if we have 1 in case of 0? On Thu, Nov 1, 2012 at 5:20 PM, Saurabh Kumar srbh.ku...@gmail.comwrote: There's nothing to do with the type of A String. The reason for which the first code gives compilation error is: operator () has higher precedence than ternary operator (?:) so, without braces

Re: [algogeeks] what to modify in given code so that dublicate permutations should not come

2012-11-01 Thread Saurabh Kumar
You'd simply have to keep track of : has particular alphabet already been used or not. You can do this by maintaining a 'used' array of 0/1 . Set and unset the respective index before and after the recursion. Here's the modified code: #includestdio.h #includestring.h #includemalloc.h *void

Re: [algogeeks] Ternary operators

2012-11-01 Thread Saurabh Kumar
There's nothing to do with the type of A String. The reason for which the first code gives compilation error is: operator () has higher precedence than ternary operator (?:) so, without braces your are actually messing up the parsing of coutstream. * cout test ? A String : 0 endl;*

Re: [algogeeks] Pre/Post L and r value

2012-11-01 Thread Saurabh Kumar
Yes, you are right. Pre increment simply increments and returns *reference*to same object. somewhat like: int operator++(int n){ n = n+1; return n; } On 31 October 2012 02:08, rahul sharma rahul23111...@gmail.com wrote: @saurabh..thnxplz provide me code snippet for pre

Re: [algogeeks] Re: Repeated values

2012-11-01 Thread Saurabh Kumar
@Vikram - your approach fails for [4 1 1 1 1] On 1 November 2012 00:09, Vikram Pradhan vpradha...@gmail.com wrote: @Don It will be an infinite loop for some cases ...like try this i=1, and a[1] = 5 , a[5] = 5 *Solution:* As the numbers are from 0 to N-1 so we can xor the value with its

Re: [algogeeks] Pre/Post L and r value

2012-10-30 Thread Saurabh Kumar
in an exprression, as you would be assigning nowhere. On 27 October 2012 20:09, rahul sharma rahul23111...@gmail.com wrote: But y post returns temp. object On Fri, Oct 26, 2012 at 8:18 PM, Saurabh Kumar srbh.ku...@gmail.comwrote: i++: Post increment can't be a lvalue because Post increment

Re: [algogeeks] C Function Pointer(Typedef)

2012-10-30 Thread Saurabh Kumar
because, pFunc is just a typedef. you'd have to instantiate a variable at least in order to call your function. like - typedef int (*pFunc) (int); pFunc fptr = func; //fptr is now a variable on stack which points to your function. fptr(5); // call that function. On 30 October 2012 01:41, rahul

Re: [algogeeks] INTERVIEW QUESTION

2012-10-30 Thread Saurabh Kumar
: the question mentioned is as it isi just copy pasted it here. @saurabh thanx for the explainaton of the cube problem i guess that is an appropriate soln for the question. and for the other question on detection of typos and suggestion i would like to know to know what 'k' in your explaination

Re: [algogeeks] Fork in c

2012-10-27 Thread saurabh singh
printf is line buffered. hence text1 remains in buffer when fork is called.this is shared by both the child and the parent when fork is called. Leaving the rest for u to conclude Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Oct 27, 2012 at 2:25 PM

Re: [algogeeks] Sequence Point C with postincremented

2012-10-27 Thread Saurabh Kumar
You're right , || all introduce a sequence point. In first case evaluation proceeds like this: j = (i++, i++); *i++* Post increment the i (i is now 11) *j = i++* Post increment the i (j is assigned 11 and i is now 12) In second case, the whole of rvalue for = operator will be evaluated

Re: [algogeeks] INTERVIEW QUESTION

2012-10-27 Thread Saurabh Kumar
could you please share the link? coz at first glance a Trie looks like a bad choice for this task. I'd go with the Levenshtein distance and a kd-tree. First implement the Levenshtein distance algorithm to calculate the edit distance of two strings. Second, since Levenshtein distance qualifies as

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread Saurabh Kumar
20 seems correct. You can also view this as all permutations of xyzabc such that the ordering xyz and abc should appear as is. On 27 October 2012 05:57, payal gupta gpt.pa...@gmail.com wrote: should be 6C3 or 20 perhaps. On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma

Re: [algogeeks] Pre/Post L and r value

2012-10-27 Thread Saurabh Kumar
i++: Post increment can't be a lvalue because Post increment internally returns a temporary object (NOT the location of i) hence you cannot assign anything to it. The result of i++ can be used only as a rvalue. ++i: whereas, in Pre-increment value gets incremented and the same location is

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread Saurabh Kumar
Since this is a small grid you can count it manually but in general problem is to count no. of paths from bottom-left corner to top-right corner (provided all the transition alphabets in the automata are distinct in the respective dimensions e.g. here, xyz in one dimension and abc in other) You

Re: [algogeeks] INTERVIEW QUESTION

2012-10-27 Thread Saurabh Kumar
Firstly, that question is missing a lot of details. In absence of those details I'm going to make soem assumptions: 1. cube is odd lengthed, so that we can define a unique center of cube. 2. While traversing from a cell(x, y, z) we can only move into any of the 6 adjacent cells[x(+-)1, y(+-)1,

Re: [algogeeks] Re: Random Number generation

2012-10-27 Thread Saurabh Kumar
, Saurabh Kumar srbh.ku...@gmail.com wrote: Take a look at Linear Congruential Generatorhttp://en.wikipedia.org/wiki/Linear_congruential_generator algorithm for generating pseudo random numbers. On 25 October 2012 16:58, bharat b bagana.bharatku...@gmail.com wrote: I heard

Re: [algogeeks] Fork in c

2012-10-27 Thread saurabh singh
Yup Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sat, Oct 27, 2012 at 8:21 PM, rahul sharma rahul23111...@gmail.comwrote: text 1 remains in buffer...nowwhen child reaches print f.it prints oldbuffer+newdata...m i ryt??? On Sat, Oct 27, 2012

Re: [algogeeks] Random Number generation

2012-10-25 Thread Saurabh Kumar
Take a look at Linear Congruential Generatorhttp://en.wikipedia.org/wiki/Linear_congruential_generator algorithm for generating pseudo random numbers. On 25 October 2012 16:58, bharat b bagana.bharatku...@gmail.com wrote: I heard that LINUX uses our past time mouse movement and keys pressed at

Re: [algogeeks] Re: c code help!!!!

2012-10-21 Thread Saurabh Kumar
Sorry, about that. Read it as: Yes a hex digit is represented by 4 bits but 1 Byte is being read using a char pointer* and you're printing the values in those Bytes. On 21 October 2012 01:03, Saurabh Kumar srbh.ku...@gmail.com wrote: Sorry, I don't understand your question. *%.2x *is only

Re: [algogeeks] Re: c code help!!!!

2012-10-21 Thread Saurabh Kumar
Sorry, I don't understand your question. *%.2x *is only a precision specifier still. (%.2x was used for neat formatting only, because you are printing the values only 1 Byte long and a Byte can occupy at max 2digits in hex) hex representated by 4 bits. Yes hex is represented by 4 bits i.e. 1 Byte

Re: [algogeeks] test cases

2012-10-21 Thread Saurabh Kumar
, Saurabh Kumar srbh.ku...@gmail.comwrote: Actually *fflush(stdin)* is the problem here, your reading of inputs is all messed up, at least on my machine( and probably on the machine you are submitting the code too). Maybe it's working fine on your particular environment but generally fflush

Re: [algogeeks] permutations using stack

2012-10-21 Thread Saurabh Kumar
answer is right there in the strings: S = PPXXPXPXPPX... Possible permutations = No. of ways to generate strings of P/X's such that in each sub-string S[0..i] no. of P's is always greater than or equal to no. of X's. You can also view this as - all possible strings of n balanced parentheses.

Re: [algogeeks] c code help!!!!

2012-10-20 Thread Saurabh Kumar
It only means - If address in hexadecimal is less than 2 digits, it will add extra padding 0's. If it's more than 2 digits it will simply print the address as is. i.e. suppose If address is *E* it will print: *0E* (padding an extra zero) that's all. On 21 October 2012 00:05, rahul sharma

Re: [algogeeks] test cases

2012-10-18 Thread Saurabh Kumar
is failing only for a particular test case .can you plz suggest any such test case. On Thu, Oct 18, 2012 at 6:08 PM, w.s miller wentworth.miller6...@gmail.com wrote: @Saurabh kumar But i have used fflush(stdin),which flushes the standard input fille. So there is nothing in stdin when i go to read

Re: [algogeeks] this pointer help c++

2012-10-10 Thread Saurabh Kumar
, rahul sharma rahul23111...@gmail.comwrote: @saurabhif i look from the way that i need to return a referencei.e. i mean object...i will ryt *this for this..i knew thisbut i have read that reference is a const pointer so if i look from this prespective then do i need

Re: [algogeeks] Virtual functions in constructor

2012-10-10 Thread Saurabh Kumar
In short: Call for virtual function in constructor is redirected to the local function because, the derived part of the object has not being initialized yet(remember you are still in Bases' constructor) and it makes no sense to call a derived's implementation of a virtual function, which in turn

Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-09 Thread Saurabh Kumar
We are attempting for DAGs only. Your graph is not acyclic. :) On 9 October 2012 21:57, Jaspreet Singh jassajjassaj...@gmail.com wrote: What if this :- a-»b ^--' c here max of both is 1 but ans is 2. On Oct 8, 2012 11:38 PM, Saurabh Kumar srbh.ku...@gmail.com wrote: You'd need: max

Re: [algogeeks] this pointer help c++

2012-10-09 Thread Saurabh Kumar
as we know reference is a const pointer That is Not quite true. our aim is ony to return pointer to circle No. our aim is to return a reference to circle. When you've to define a reference you do something like: *Circle ref = c;* you *don't* do: *Circle ref = c;* Right ? Same is the case

Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-08 Thread Saurabh Kumar
You'd need: max(#vertices-with-0in-degree, #vertices-with-0out-degree) edges at least. On 8 October 2012 20:20, bharat b bagana.bharatku...@gmail.com wrote: @jaspreet: take an ex: B-A B-C B-D Here the no.of zero-indegree is one . But its not the correct ans. On Mon, Oct 8, 2012 at 1:19

Re: [algogeeks] Nested Function C

2012-10-03 Thread Saurabh Kumar
It's compiler dependent. gcc comes from GNU project. ANSI C doesn't allow nested function definitions. On 3 October 2012 01:06, rahul sharma rahul23111...@gmail.com wrote: Guys i have read that we cant define function in another function in c Then why this followung program running fine on gcc

Re: [algogeeks] Facebook question!

2012-10-01 Thread saurabh agrawal
Do we need to handle cases when the same string will appear again?? In that case we can sort individual array and remove duplicates. On Mon, Oct 1, 2012 at 9:54 AM, Rahul Singh riit1...@gmail.com wrote: check this out.. #includeiostream #includestdlib.h using namespace std; void

Re: [algogeeks] Re: Make My Trip *URGENT*

2012-09-22 Thread saurabh arora
can anyone tell makemytrip for quality assurance look for coding or not?? -- 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: Snapdeal placement proceedure

2012-09-07 Thread saurabh arora
hiee. wat about the analyst profile procedure..plz help!! -- 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] LOGIC!!!

2012-08-30 Thread Saurabh Kumar
I think, if the Graph is 2-colorable (i.e. Bipartite) trip can be arranged. On 30 August 2012 09:43, ashish mann ashishman...@gmail.com wrote: 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

Re: [algogeeks] directi paper pattern

2012-08-02 Thread saurabh singh
Please stop this idiocity of *me too,me too * You can send personal mails to the author,why spam the group? No More Posts on this thread. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com -- You received this message because you are subscribed to the Google

Re: [algogeeks] pls guy im need of a ebook named Data Structures and algorithms made easy details given below....

2012-07-20 Thread saurabh singh
Above users banned for violating group policy. NO MORE POSTS ON THIS THREAD. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Fri, Jul 20, 2012 at 11:39 PM, suresh kumar mahawar suresh.mahawar1...@gmail.com wrote: On Fri, Jul 20, 2012 at 11:02 PM

Re: [algogeeks] Re: Finding the repeated element

2012-07-19 Thread Saurabh Yadav
@deepikaanand (checksum 1 100) will it work ? as i know int has only 32 bits !! Thanks Regards Saurabh Yadav -- 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] Anagram problem

2012-07-18 Thread saurabh singh
^sorting a string would be o(n^2logn) if u use q.sort.count sort would be better. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Wed, Jul 18, 2012 at 1:08 PM, vindhya chhabra vindhyachha...@gmail.comwrote: sort the list,sort the word(use quick sort

Re: [algogeeks] A Coding Problem

2012-07-14 Thread saurabh singh
its from a running contest i believe.This is against the group policy as well as against the ethics of programmers. The author of this post is banned permanently from algogeeks. Kindly no more posts on this thread till 16th July (the date mentioned as end of contest in the given link). Saurabh

Re: [algogeeks] Re: [Google] Finds all the elements that appear more than n/3 times

2012-06-30 Thread saurabh singh
@above On Thursday, 28 June 2012 04:05:12 UTC+5:30, Navin Kumar wrote: Design an algorithm that, given a list of n elements in an array, finds all the elements that appear more than n/3 times in the list. The algorithm should run in linear time ( n =0 ). You are expected to use

Re: [algogeeks] MS Question: Segregrate positive and negative nos in array without changing order

2012-06-29 Thread saurabh singh
duplicate of a previous post.Kindly refer to that post. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Fri, Jun 29, 2012 at 10:41 AM, raghavan M peacelover1987...@yahoo.co.inwrote: Hi Question as in subject *No extra space (can use one extra space)-O

Re: [algogeeks] Switch doubt in C

2012-06-29 Thread saurabh singh
the cases are simple lables they have nothing to do with the flow of program. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Fri, Jun 29, 2012 at 3:14 PM, adarsh kumar algog...@gmail.com wrote: Doubt, very trivial though: #includestdio.h int main

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

2012-06-26 Thread saurabh singh
^ Does it make any difference? Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Tue, Jun 26, 2012 at 5:32 PM, Navin Kumar algorithm.i...@gmail.comwrote: whether it is in character array or integer array?? On Tue, Jun 26, 2012 at 3:40 PM, Ashish Goel

Re: [algogeeks] Programming Question

2012-06-22 Thread saurabh singh
+1 to Trie Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Fri, Jun 22, 2012 at 3:50 PM, Karthikeyan V.B kartmu...@gmail.comwrote: Tries -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Reverse Queue

2012-06-20 Thread saurabh singh
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards, Saurabh -- 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] Reverse Queue

2012-06-20 Thread saurabh singh
: delete from front and adding to rear: queue will be: 2 1(front at 2 , rear at 1) second iteration: deleting 2 and adding to queue :result will be: 1 2 (front 1, rear 2) On Wed, Jun 20, 2012 at 6:46 PM, Navin Kumar algorithm.i...@gmail.comwrote: @Saurabh: queue will be remain unchanged

Re: [algogeeks] Reverse Queue

2012-06-20 Thread saurabh singh
...@gmail.comwrote: @Saurabh: queue will be remain unchanged according to your algorithm. Because if you will delete an element from front and add at rear no change will be there. After n iteration front will be pointing to same element and rear will also point to same element. Correct me if i am wrong

Re: [algogeeks] Reverse Queue

2012-06-20 Thread saurabh singh
How ?? I am asking to manipulate the same queue. Dequeue n-1 elements and enqueue them in order to you take out to the same queue..Where is extra space involved ? On Wed, Jun 20, 2012 at 8:36 PM, Navin Kumar algorithm.i...@gmail.comwrote: @saurabh : i want solution with space complexity of O(1

Re: [algogeeks] Reverse Queue

2012-06-20 Thread saurabh singh
. Think about it :). Then you have to take stack or some other data structure. On Wed, Jun 20, 2012 at 8:40 PM, saurabh singh saurabh.n...@gmail.comwrote: How ?? I am asking to manipulate the same queue. Dequeue n-1 elements and enqueue them in order to you take out to the same queue..Where

  1   2   3   4   5   6   7   >