Surprisingly, if I comment the last if condition ( which is AFTER red() call
), it is printing red only 6 times as expected.. http://ideone.com/XMHzC
main()
{
fork();
int color=fork();
if(color==0)
fork();
red();
//if(color==0)
//
For questions specifically asking about test cases, I would suggest
following 3 step approach:
First think of a* basic flow that MUST work for the application* (what is
expected with the application. Firstly make it clear with you interviewer).
eg:
1) User should be able to open Notepad
It was posted recently..
Check the achieves. :)
--
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/-/Lv9GSMFFS00J.
To post to this group, send email to
Typo: achieves -- archives
--
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/-/ccCkVtfs3y4J.
To post to this group, send email to algogeeks@googlegroups.com.
any O(nlogn) solution?
--
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/-/7Q8DHLIlbDoJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
Guys, How about the below mentioned implementation?
The only assumptions is that nodes should exist in the tree. (will fail if
one node exists and another doesn't)
static Node LCA(Node root, int d1, int d2){
if(root==null)
return root;
if(root.left!=null ( root.left.data == d1 ||
Check out second run of same code: http://ideone.com/TK4qu. This time it
printed only 8 times.
The reason behind this is that, you are using a web based compiler and it
sends back the output as soon as main completes its execution. However
forked child are yet to complete.
--
You received
@Ankur, what if the numbers are 23 232??
23 add 0 == 230
Since, 232 230 === 232 should come first..
Hence answer: 23223.
However; 23232 is greater..
wutta say? :-/
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion
Not Sure! Me too looking for a solution.. :D
So far, Kunal's approach (Convert each string to length max_size where you
append it circularly) seems to be working fine. :-)
..and Chengjie's approach should also work, but the interviewer rejected
this idea saying, he wants a good logic for
Yeah got it. Thanks :)
--
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/-/NAqtuyQmehgJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
Hi!
Any good source for dynamic programming problems (along with concept)??
No lmgtfy, Please.
Direct links will be appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
An array of strings is given and you have to find out whether a circular
chain with all character can be formed or not?
Circular chain is formed in way that: if last char of a string is equal to
first char of another string then it can be joined.:
like ab bxc === axbbxc
@Raghavan,
Thanks man :)
--
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/-/lGIZaHYTu3cJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
Me too didn't get Raghavan's algo... Pls explain..
It seems that above algo will find only longest sequence starting from index
0.
Just a thought:
Along with raghavan's algo, what if I keep and
array_of_integers[string_length]
and keep on storing the count in this array.
Once string is
Hey, can anyone pls share logic/pseudo code for N*M?
(When N can be less than or greater than M.)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
...
if(something)
return true;
else
return false;
.
// few statements here
.
Will few statements ever execute??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
why following?
if(first==last)
return false;
example:
axxa, ayyb, bzza === ayybbzzaaxxa
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
Kudos to Aditi. :D
--
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/-/gnhokgp_zV0J.
To post to this group, send email to algogeeks@googlegroups.com.
To
Typically first round is coding on paper. (they will ask you to code 2-3
problems.)
Brush up bitwise operations ( shifting, and, or, xor), Strings Arrays
problems.
You may get tree/ll questions as well. but their solutions won't be too
large.
Like other companies, in interview, mainly DS/OS
Oh! come on. It is working! :)
anyways, I have mirrored it at http://goo.gl/rbSNE
Cheers! \o/
--
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/-/iHSvoolOJwgJ.
I havn't attended citrix's campus drive this year.
This is the last year's process. Hopefully would be same. :)
Good Luck!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@gopi,
Mirrored link http://goo.gl/rbSNE is also not working???
it is a 15.5mb file, will take some time to appear on browser (incase you r
using FF).
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@Sagar
..an array which is sorted but rotated by some k places which is nt kwn
Kindly note that: ARRAY IS KNOWN, k is NOT known.
If the array is not known then where will you search an item??? :P :P
--
You received this message because you are subscribed to the Google Groups
Algorithm
An array of integers is given and you have to find the largest possible
integer by concatenating all elements:
example:
array: 87 36 52
answer: 875236
array: 87 9 52
answer: 98752
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view
Kindly check it with both the examples. It won't work.
--
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/-/VlT1DNH-vPkJ.
To post to this group, send email to
@dave,
Awesome approach. It was really tough to find a counter example. :D
1st number: 23
2nd number: 23235
Applying ur algo:
23 - 2
-- 23235
Answer using ur algo: 2323235
However the correct answer should be: 2323523
Am I missing something in the above example? :-/
--
You
how abt http://ideone.com/lN2og ??
--
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/-/pZdvFb_t2b4J.
To post to this group, send email to
let say a=6; binary= 0110
b = ~a = 1001
Now when you print value of ~a or b, it is calculating 2's complement.
1's complement: 0110
2's complement: 0111 (value = -7)
Pls check signed bit representation for details.
On Aug 7, 4:40 pm, Shashank Jain shashan...@gmail.com
Engineering
Delhi College of Engineering
On Sun, Aug 7, 2011 at 5:39 PM, Yasir yasir@gmail.com wrote:
let say a=6; binary= 0110
b = ~a = 1001
Now when you print value of ~a or b, it is calculating 2's complement.
1's complement: 0110
2's complement: 0111 (value
0111
--
0
Kindly, check out following link for more details on 2's complement:
http://academic.evergreen.edu/projects/biophysics/technotes/program/2s_comp.htm
Thanks,
Yasir
On Aug 7, 6:01 pm, Shashank Jain shashan...@gmail.com wrote:
nd moreover
Guys,
Let's try to find out an efficient solution for the following prob:
Given N numbers , [N=10^5] we need to count the total pairs of
numbers that have a difference of K. [K0 and K1e9]
Input Format:
1st line contains N K.
2nd line contains N numbers of the set. All the N numbers are assured
=(x+K),if the elements are not distinct
then the number of pairs will be the upper_bound()-lower_bound() for y.
Complexity:O(nlogn)
On Sun, Aug 7, 2011 at 11:23 PM, Yasir yasir@gmail.com wrote:
Guys,
Let's try to find out an efficient solution for the following prob:
Given N
@Shuaib,
You are right, this approach will work! :)
But for each element 'e'
instead of checking whether *|K-e| *exists, *you should check for either
(e+K) or (e-K).*
But here the question is, will the hash map really give o(1) access for such
a large record?
..and is it a good practice to
You can take out sample test at
http://www.interviewstreet.com/recruit/test/start/sample
Amazon uses same env for online coding test.
On Aug 6, 5:55 pm, Atul Verma atul.iit...@gmail.com wrote:
it's not like cc format. first they'll ask ur logic and then they see ur
code. (no submission
Earlier they had telephonic interview as first round but now this
online exam has become initial screening test.
Based on ur online test's performance they call for phonic round or on-
site interview.
In online test, there there are 10 mcq questions and 5 coding probs.
Cheers \o/
On Aug 6, 7:17
Almost same.
For big probs, they don't ask for running code. Only pseudo-code is
enough.
On Aug 6, 9:42 pm, Ankur Garg ankurga...@gmail.com wrote:
The questions in the link are quite decent...Is the toughness level of
Amazon test same or more ?
On Sat, Aug 6, 2011 at 11:47 AM, shady
Same as of DS Algo in GATE exam.
http://geeksforgeeks.org/?cat=66
On Aug 7, 2:29 am, Ankur Garg ankurga...@gmail.com wrote:
@Yasir
MCQ are of which types ???
Regards
Ankur Garg
On Sat, Aug 6, 2011 at 4:45 PM, Yasir yasir@gmail.com wrote:
Earlier they had telephonic interview
37 matches
Mail list logo