Forum Posts
- 1 Answer django
How to populate the choicefield with a few initial values?
- brijesharmy February 18, 2014| Flag | PURGE - 0 Answers Given a positive integer k ≥ 2...
Given a positive integer k ≥ 2, an array A[1..n] with n distinct integers, n = k^m ≥ 1, and
- mahitha.cams February 16, 2014
an integer key x. Design a k-ary search algorithm by extending the standard binary search
algorithm for searching the array A for x . Based on the number of comparisons between x
and the elements in A, set up and then solve the corresponding recurrence equation for the k-ary
search algorithm for Tw(n). Can you determine the value of k for the best performance k-ary
search algorithm.| Flag | PURGE - 0 Answers Given an array A[1..n] with n ...
Given an array A[1..n] with n distinct integers, n = 4^m ≥ 4. By dividing A into four
- mahitha.cams February 16, 2014
equal parts, design an efficient DAC merge sort algorithm by extending the standard merge
sort algorithm for sorting A. Assuming that it will take 2n-3 comparisons to merge the four
sub arrays together, based on the number of comparisons between elements in A, set up the
recurrence equation for Tw(n) and then compute it in closed-form.| Flag | PURGE - 0 Answers Given an array A[1..n] and a k...
Given an array A[1..n] and a key x, n = 3 ^k ≥ 1. If Pr(x belongs to A) = 3/8
- mahitha.cams February 16, 2014
and, if x is in A, the
probability that x is in the first third of the array is three times more likely for x to be in the
second third of the array, and the probability that x is in the second third of the array is twice
more likely for x to be in the last third of the array. Furthermore, if x is in any third part of the
array, x is equally likely to be found in any one of the positions in that part of the array. Based
on the number of comparisons, compute Ta(n) if sequential search is performed on A for x.
You must set up the equation for Ta(n) and then evaluate the sums. Do not simplify your
expression| Flag | PURGE - 0 Answers merge sort algorithm
Given an array A[1..n] and a key x, n = 3 ^k greater than or equal to 1. If Pr(x belongs to A) = 3/8
- mahitha.cams February 16, 2014
and, if x is in A, the
probability that x is in the first third of the array is three times more likely for x to be in the
second third of the array, and the probability that x is in the second third of the array is twice
more likely for x to be in the last third of the array. Furthermore, if x is in any third part of the
array, x is equally likely to be found in any one of the positions in that part of the array. Based
on the number of comparisons, compute Ta(n) if sequential search is performed on A for x.
You must set up the equation for Ta(n) and then evaluate the sums. Do not simplify your
expression| Flag | PURGE - 0 Answers merge sort algorithm
Given an array A[1..n] and a key x, n = 3k 1. If Pr(xA) = 3
- mahitha.cams February 16, 2014
8
and, if x is in A, the
probability that x is in the first third of the array is three times more likely for x to be in the
second third of the array, and the probability that x is in the second third of the array is twice
more likely for x to be in the last third of the array. Furthermore, if x is in any third part of the
array, x is equally likely to be found in any one of the positions in that part of the array. Based
on the number of comparisons, compute Ta(n) if sequential search is performed on A for x.
You must set up the equation for Ta(n) and then evaluate the sums. Do not simplify your
expression| Flag | PURGE - 12 Answers array puzzle load balance
There is a array indicating the load on each server like this
- pvpkiran February 14, 2014
0,0,10,0,0,0,0,0,0,0
each servers can share load with its neighbours, and it can only share 1 unit per second. like this
0,1,8,1,0,0,0,0,0,0
so how many seconds needed to distribute the load equally.
so for the above case the next step is
1,1,6,1,1,0,0,0,0,0
so totally this sequence needs 7 seconds to make it
1,1,1,1,1,1,1,1,1,1
for the case where input is 27,28
the result shud be 0. Because it can't be balanced.| Flag | PURGE - 0 Answers Variation in finding Stirling numbers of the first kind
There is a famous recursive relation to find Stirling numbers of the first kind, i.e.
- cadam940 February 13, 2014
C(n,k)=C(n−1,k−1)+(n−1)C(n−1,k)
This is a solution to the following problem:
Given a set of N distinct numbers, how many different permutations of the set exist such that there are exactly K left-to-right maxima?
This was not very hard, but the following little variation:
Given a multiset of N numbers (not necessarily distinct), how many different permutations of the set exist such that there are exactly K left-to-right maxima (see definition below)?
Example:
Let the multiset be S={1,2,2,3} [Note: the two 2s should be considered non-identical while permuting] and K=3. Then, the following permutations:
<1,2,2,3>
<1,2,2,3>
<1,2,3,2>
<1,2,3,2>
satisfy the required condition. Hence, the answer should be 4 (we do not need to find all the permutations but we are interested in the number of such permutations).
Definition: An element should be considered a maximum if and only if all the elements occurring before it are strictly less than it.
For example, in the above example <1,2,2,3>, the second 2 is not maximum but the first 2 is. Hence, this arrangement satisfy K=3 (not K=4).| Flag | PURGE - 2 Answers Palindrome number or not
find whether a number is palindrome or not if number is not palindrome ( i.e 112 ) make it in a palindrome form and check if it is palindrome or not.
- napender February 12, 2014
Example - 121 this is a palindrome number but 112 is not palindrome so make it 121 and check.| Flag | PURGE - 0 Answers Algorithm to generate minimum number of spheres to contain 3Dpoints
Given a set of input points (3D)
- p.phanikrishna February 11, 2014
A sphere can contain many points, and radius of sphere is variable.
How many spheres (minimum) are required to contain all given input points?| Flag | PURGE - 0 Answers Algorithm
Consider an implicit binary min-heap with n distinct elements. Let k be an integer much
- algorithm February 09, 2014
smaller than n, but not a constant. The root of the heap contains the smallest value. Where
in the heap can the kth smallest value be located? Be precise. Describe how to find the kth
smallest value, given a heap (which you cannot modify!) in time dependent on k, but not n.
What is the algorithm? What is its worst-case running time? Be precise.| Flag | PURGE - 3 Answers github link on resume
I'm wondering whether to link to my github account on my resume/CV
- SBD February 09, 2014
It's got half a dozen historical small projects I've done over the years, some complete, others not so. The oldest stuff dates back to 1994. There's one project in progress. My followers/starred/following counts are at 0.
Would an interviewer even bother to go and look at it?
I was thinking of putting something like:
github[link] includes: X86/SPARC interpreter, Android game, Python Kivy game, irc bot| Flag | PURGE - 3 Answers Preparing for on-site interview with Amazon Web Services
Hi. I made it through 2 phone screens with AWS Core Engine team. I'm scheduled for an on-site in the next week, and I'm wondering if anyone else has gone through a interview loop for software engineer with AWS (specifically Core Engine) and can provide a list of areas I should prepare for more than others. Because it's a cloud platform, I suppose anything related to concurrency, load balancing, distributed caching, networking, and general distributed system problems are all fair game. I don't have any real cloud computing experience and don't want to be caught off guard with subject matter that I didn't prepare for. Outside of general distributed system studies, I would probably expect more DP problems and graph theory.
- wazzugrad February 07, 2014
I did go through a Amazon interview 5 years ago, but the bar raiser killed me. I'm expecting significantly harder questions this time around. Any final words of advice?
Thanks!| Flag | PURGE - 1 Answer void pointers and arrays
void *c;
- piyush.411031 February 05, 2014
c=(void *)malloc(sizeof(float)*400);
now as c is a void pointer pointing to a memory block of said size.
Now the block so pointed will contain garbage , and can be treated as an array:
So if I want to print/access all the values so stored as float , how can I do it?
I have tried normal access thru pointers and loops and it throws an error "void is not a pointer to object type"...| Flag | PURGE - 1 Answer Who is our boss
Initech is a company which has CEO Bill and a hierarchy of employees. Employees can have a list of other employees reporting to them, which can themselves have reports, and so on. An employee with at least one report is called a manager.
- gundam0083ster February 02, 2014
Please implement the closestCommonManager method to find the closest manager (i.e. farthest from the CEO) to two employees. You may assume that all employees eventually report up to the CEO.
Bill
CEO
|
-----------------------
| | |
DOM SAMIR MICHAEL
|
-------------------
| | |
BOB PETER PORTER
|
-----
| |
MILTON NINA
Sample Data: CEO Bill has 3 employees reporting to him: {Dom, Samir, Michael} Dom has three reports { Peter, Bob, Porter} Samir has no reports {} Michael has no reports {} Peter has 2 reports {Milton, Nina} Bob has no reports {} Porter has no reports {} Milton has no reports {} Nina has no reports {}
Sample calls: closestCommonManager(Milton, Nina) = Peter closestCommonManager(Nina, Porter) = Dom closestCommonManager(Nina, Samir) = Bill closestCommonManager(Peter, Nina) = Peter| Flag | PURGE - 0 Answers Who is our boss
Initech is a company which has CEO Bill and a hierarchy of employees. Employees can have a list of other employees reporting to them, which can themselves have reports, and so on. An employee with at least one report is called a manager.
- gundam0083ster February 02, 2014
Please implement the closestCommonManager method to find the closest manager (i.e. farthest from the CEO) to two employees. You may assume that all employees eventually report up to the CEO.
Bill
CEO
|
-----------------------
| | |
DOM SAMIR MICHAEL
|
-------------------
| | |
BOB PETER PORTER
|
-----
| |
MILTON NINA
Sample Data: CEO Bill has 3 employees reporting to him: {Dom, Samir, Michael} Dom has three reports { Peter, Bob, Porter} Samir has no reports {} Michael has no reports {} Peter has 2 reports {Milton, Nina} Bob has no reports {} Porter has no reports {} Milton has no reports {} Nina has no reports {}
Sample calls: closestCommonManager(Milton, Nina) = Peter closestCommonManager(Nina, Porter) = Dom closestCommonManager(Nina, Samir) = Bill closestCommonManager(Peter, Nina) = Peter| Flag | PURGE