gave
is to show that choosing greedily arbitrarily does not give optimal
solution because some other better solution exists.
-Thanks
Bujji
On Sat, Nov 18, 2017 at 1:17 AM, MeHdi KaZemI <mehdi.kaze...@gmail.com>
wrote:
>
> The Greedy observation is something like this: the leftmost
rom left edge to right edge. (2+4
=6). But we can see if we choosing greedily from one end gives cost 2+1+1
= 4. Why greedy approach from one end succeeds while choosing arbitrarily
fails.
Any hints or proofs is greatly appreciated.
--
-Thanks
Bujji
--
You received this message because
transfer cards at same instant ).
Prove that at some point of time,
some person will have same number on both his cards.
-Thanks
Bujji
--
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
starts from 0) is
5.
We can use additional storage.
-Thanks
Bujji
--
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.
score(int player_id);
void updateScore( int plaer_id, int score );
-Thanks
Bujji
--
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
structure can use O(n log n) space and
have
O(log n) query time.
-Thanks
Bujji
--
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
Hi,
Can you please where can I get get design questions like air traffic
controller, Lift, parking system, Logging module with answers, UML
diagrams, possible solutions?
Any online resources or even a good book to buy?
-Thanks
Bujji
--
You received this message because you
in proof.
@Dave Can you give some intuition behind your statement?
-Thanks
Bujji
On Wed, May 29, 2013 at 8:54 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote:
@DAve
any proper reason or link to proof that at least twice can be solved using
greedy but others are not??
On Tue, May 28, 2013
with different path lengths and order of evaluation of
paths.Evaluating recursion paths from greater
run length to smaller run lengths will result in updating distance[i][j]
several times.
Any improvements can we think of to improve this to achieve O(XY) bound?
-Thanks
Bujji.
On Mon, Apr 21, 2014
Hi Don,
At most we can reach a point from 4 adjacent points. So, time
complexity will be O(XY) only.
-Thanks,
Bujji.
On Mon, Apr 21, 2014 at 1:38 PM, bujji jajala jajalabu...@gmail.com wrote:
Hi Don,
Nice solution. good. Looks like in your markShortestPath(int
) algorithm.
If we walk in down or right directions only Dynamic programming solution
would be simple. But because of bad intersection points, we may need to
walk in up, down, right or left directions.
-Thanks
Bujji
--
You received this message because you are subscribed to the Google Groups
of egg droppings that will
always
suffice.
Show that E(k, n) = Θ(n^(1/k))
-Thanks
Bujji
--
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
Hi Raja,
You can store positions cuts in a separate 2d array ( say
C[i][j] ) similar to S[i,j] to store optimal cut position for string
running from index i to j and use recursion to print cut positions.
-Thanks
Bujji
On Thu, Oct 17, 2013 at 3:21 AM, kumar raja rajkumar.cs
Hi Varun,
Are there any restrictions on k1, k2, k3 ... ?
If not Just choose k_i = a_i i=1,2,..,n. :-)
-Thanks
Bujji
On Sat, Mar 23, 2013 at 7:23 AM, Varun tewari.va...@gmail.com wrote:
Hello all,
I have this problem to solve, and seek your assistance.
Program should
Hi Don,
Good one :) Nice to see different approaches for this problem.
-Thanks,
Bujji
On Fri, Jan 10, 2014 at 9:11 AM, Don dondod...@gmail.com wrote:
Sort the input string and remove duplicates, keeping a count of the number
of occurrences of each character.
They you can build
programn :).
-Thanks,
Bujji
On Thu, Jan 9, 2014 at 3:56 AM, bujji jajala jajalabu...@gmail.com wrote:
Hi Nishanth Pandey,
Excellent solution! It meets all
requirements in problem!
One thing I am finding hard to understand is your duplicate functions
*/
return true;
return false;
}
Why are you skipping if you find element you want to swap in between start
and end indexes in duplicate function?
Please let me know you intuition.
-Thanks,
Bujji
On Tue, Jan 7, 2014 at 6:08 AM, Nishant Pandey nishant.bits.me...@gmail.com
wrote
should generate n! / ( n_1! * n_2! * * n_m! ) strings.
Ex:
aba is given string
Output:
aab
aba
baa
-Thanks,
Bujji
--
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
should generate n! / ( n_1! * n_2! * * n_m! ) strings.
Ex:
aba is given string
Output:
aab
aba
baa
-Thanks,
Bujji
--
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
Output:
aab
aba
baa
Ex2: aaa is given input string
Output
aaa
-Thanks,
Bujji
--
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
increasing run in a numerical sequence is
straightforward.
Indeed, you should be able to devise a linear-time algorithm fairly easily.
Sorry, After reading it again I see that those should be neighbours.
I have interpreted longest increasing run wrongly.
-Thanks,
Bujji.
On Tue, Dec 17, 2013 at 1:17 PM
Given an Array of integers (A1,A2,...,An) of length n, Find the maximum
possible length of increasing sub sequence formed from A1, A2,,An.
I read that it is possible to compute in linear time as mentioned in
algorithm design manual bySkiena.
-Thanks
Bujji
--
You received this message
Can you please explain your Algorithm to implement queue using stack
in O(1) time?
On Oct 18, 1:43 pm, juver++ avpostni...@gmail.com wrote:
The amortized time is O(1) for extracting and pushing elements from/in
the queue.
On 18 ÏËÔ, 12:01, Mallesh Kavuluri mallesh...@gmail.com wrote:
...@gmail.com wrote:
Please refer to the following link for the explanation:
http://stackoverflow.com/questions/69192/using-stack-as-queue
On 18 окт, 14:06, bujji jajalabu...@gmail.com wrote:
Can you please explain your Algorithm to implement queue using stack
in O(1) time?
On Oct 18, 1:43 pm
Number of BST with n keysf(n) = [ \sum_{ i=1 to n} f(i-1)* f(n-
i) ]
Root node can be any of n keys. if it is ith ney in ascending order,
it has i-1 keys to left and n-i keys to right.
Can any one explain how/Why is it equal to catalan number?
-Thanks
Bujji
On Aug 1, 1:08 pm, Manjunath
@Anand,
It looks like your algorithm takes O(log N ) time.
Repeatedly choosing one half or the other half.
Similar to binary search.
Please correct me if I am worng.
-Thanks and regards,
Bujji.
On Jul 27, 12:29 am, Anand anandut2...@gmail.com wrote:
*
*
*Using partition
Median can be computed in O(1) time after the element is inserted into
existing DS.
But inserting a new element in to the AVL takes O(log n) time.
Overall it takes O(log n) time including inserting new element and
median computation.
Can median be computed in O(1) time on the fly?
On Jul 28,
,
Bujji
On Aug 1, 4:00 pm, UMESH KUMAR kumar.umesh...@gmail.com wrote:
Write a C code for generate all possible Permutation
as:- 1 2 3
Total no. of Per=6
also print all permutation
as:- 1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
if inpute is 1 2 3 2
Hi Anand,
Can you please explain your code? What is the magic
number 10 in
if(k == 10)
{
printf(String Matched\n);
}
in your code?
What does while loop do in your code? Can you please write a comment?
-Thanks in advance,
Bujji
#include stdio.h
#include
29 matches
Mail list logo