Re: [algogeeks] Bulk Problem:

2010-02-22 Thread Miroslav Balaz
i solved it using special sweep method, but can by solved by quad tree also. 2010/2/17 Piyush Verma 114piy...@gmail.com any algorithm to solve this problem... ACM uses a new special technology of building its transceiver stations. This technology is called Modular Cuboid Architecture (MCA)

Re: [algogeeks] INTERVAL SATISFIABILITY PROBLEM

2010-02-10 Thread Miroslav Balaz
EASY! 2010/2/10 Rohit Saraf rohit.kumar.sa...@gmail.com There are n men. And you have been given say m information's like : m_i was born after m_j died m_i talked to m_j sometime You need to find the consistency of the sets of information in O(n+m). -Rohit -- You received this

Re: [algogeeks] Dijkstra For Longest Path?

2010-01-14 Thread Miroslav Balaz
longest path can be solved in acyclic directed graphs. so check your case if it is not that. 2010/1/15 Vivek S s.vivek.ra...@gmail.com @chitta koushik No, That might lead to negative edge cycles! 2010/1/15 chitta koushik koushik.infin...@gmail.com How abt negating values and using same

[algogeeks] Re: coloring (Marking)

2009-10-09 Thread Miroslav Balaz
LOL search for dominance in graph. 2009/10/7 ankur aggarwal ankur.mast@gmail.com Given a graph.. Find the minimum number of coloring (Marking) required to node such that every node in the final graph is connected by at least one of the colored(marked) node. ex: AB AC BD BE CF

[algogeeks] Re: Graph Limited Flow !

2009-09-30 Thread Miroslav Balaz
So at each step you can move any number of beads form some betwwen some pairs (in particular more than one) of adjecent vertices? It seems to be complicated problem. IMHO it is about some routing strategy than graph flow. If you do reduction to edge capacit, than the maximum flow and longest path

[algogeeks] Re: Graph Limited Flow !

2009-09-30 Thread Miroslav Balaz
, the ford fulkerson algorithm and others ... On Wed, Sep 30, 2009 at 3:46 AM, Miroslav Balaz gpsla...@googlemail.comwrote: So at each step you can move any number of beads form some betwwen some pairs (in particular more than one) of adjecent vertices? It seems to be complicated problem

[algogeeks] Re: Graph Limited Flow !

2009-09-30 Thread Miroslav Balaz
this . Max flow - min cut theorem , the ford fulkerson algorithm and others ... On Wed, Sep 30, 2009 at 3:46 AM, Miroslav Balaz gpsla...@googlemail.com wrote: So at each step you can move any number of beads form some betwwen some pairs (in particular more than one) of adjecent vertices

[algogeeks] Re: Finding repeated element in most efficient way

2009-08-18 Thread Miroslav Balaz
each number except one is there only once, and one number that repeats can repeat power of two times. 2,4,8,16. the best solution is to use trie, it is linear in number of bits of input. But It is interresting if there is solution using unit cost arithmetics. Or by using randomized algorithm, and

[algogeeks] Re: Looking for a suffix tree implementation with Unicode support

2009-08-18 Thread Miroslav Balaz
What you mean by unicode supprot? I think only problem is that characters that look the same may have different encodings. So it is enough in each compare to use the function that resolves above problem. I made 3 suffix tree implementations and it is easy to change string type in that. But my

[algogeeks] Re: bits required to convert A to B

2009-08-17 Thread Miroslav Balaz
__bitcount(a ^ b), or use bitset32 or int x=0; int y=a^b; while(y) {x++;y=y-1;} return x; 2009/8/17 Pramod Negi negi.1...@gmail.com i guess XORing A and B and count the no of set bits will do. On Sun, Aug 16, 2009 at 11:09 PM, richa gupta richa.cs...@gmail.comwrote: Given two integers A

[algogeeks] Re: Question asked in MS interview

2009-08-15 Thread Miroslav Balaz
I think the teoreticaly easiest solution is to have two balanced binary search trees interlinked. on for finding by string, second for keeping count second can keep subtree sizes, and every time you check the position and if it changes then you can update list, you do not have to make more

[algogeeks] Re: Check divisibility by 3

2009-08-14 Thread Miroslav Balaz
Just substract 3 till grater than 2 if you end with 0 it is divisible othervise not, or you can binary search the result division by 2 is just shift. 2009/8/14 Yogesh Aggarwal yogesh.aggarwa...@gmail.com @arun : we are not supposed to use / operator. but in ur algo u r using / or % has to be

[algogeeks] Re: Division into 2 sets

2009-08-14 Thread Miroslav Balaz
NP-COMPLETE 2009/8/14 fundoonick fundoon...@yahoo.co.in Problem: I have a set of positive integers. I have to divide it into 2 sets such that the difference of the sums of both sets is minimum. For ex, the given set of +ve integers is: 1,2,3,4 I divide it into 2 sets {1,4} and {2,3} such

[algogeeks] Re: Constraint 3-Coloring --- P or NP-Complete ?

2009-08-13 Thread Miroslav Balaz
Ok your question have some little catch hidden. But first let me was the question. Does each vertex has at least one forbiden color? because if you can have no forbiden colors you end up with clasical 3-coloring problem which is NP-Complete. The catch is that if P=NP then everything nontrivial is

[algogeeks] Re: joining two STL priority_queues

2009-08-08 Thread Miroslav Balaz
as arrays have fixed size Also fibonacci heaps support union of heaps. Arun, On Sat, Aug 8, 2009 at 1:32 AM, Miroslav Balaz gpsla...@googlemail.comwrote: No there si no such function. The best solution would be not to use priority queue, but other design. If it wont work you can try to use

[algogeeks] Re: joining two STL priority_queues

2009-08-07 Thread Miroslav Balaz
No there si no such function. The best solution would be not to use priority queue, but other design. If it wont work you can try to use splay tree. But it has big overhead. Theoreticaly best would be fibbonaci heap but it heas even bigger overhead than splay tree. 2009/8/7 mirosuaf

[algogeeks] Re: polynomial algorithme for isomorphic graphs

2009-07-19 Thread Miroslav Balaz
demonstration. but I must know two things if you enjoy: 1) are that I must show that the distance between A and B equals the distance between f (A) and f (B)? 2) are that the algorithm is to explain or not? and thank you On 18 juil, 16:29, Miroslav Balaz gpsla...@googlemail.com wrote

[algogeeks] Re: polynomial algorithme for isomorphic graphs

2009-07-16 Thread Miroslav Balaz
such errors there. 2009/7/15 mimouni mimouni.moha...@gmail.com you can consult in: http://www.wbabin.net/science/mimouni2e.pdf and I finished on implimentation schedule a php (to find the labels for a graph exceeds 5000 vertices). On 14 juil, 19:25, Miroslav Balaz gpsla...@googlemail.com wrote

[algogeeks] Re: polynomial algorithme for isomorphic graphs

2009-07-16 Thread Miroslav Balaz
And also you should answer the main question , how will you find the automorphism function? Or how would you use the theorem only to decide if there exists an isomorphism? 2009/7/16 Miroslav Balaz gpsla...@googlemail.com I think that there is logical error, in the proof what do you think about

[algogeeks] Re: about Acm programming competition Questions in year 2004-2005

2009-07-13 Thread Miroslav Balaz
LOL program it yourself, nobody will do work for you here. We can only help someone by giving advice, or discussing interesting topics. 2009/7/12 Davood Vahdati davoodvahdati2...@gmail.com Dear sirs and madams : I Wan't C++ Source Code program About thos questions in Acm 2004-2005Problems

[algogeeks] Re: Room Permutation Algorithm

2009-07-09 Thread Miroslav Balaz
LOL, you should heve some ordering of elements, and only cnstruct nondecreasing sequence like nuber are like ordered by liek a value, and you can like order any finite set like you want. 2009/7/9 lad4bear lad4b...@gmail.com Thanks for all the help guys. And Geoff, sorry to be a pain but can

[algogeeks] Re: permuting the elements of an array

2009-06-23 Thread Miroslav Balaz
It is also so easy, but maybe requires more lines of code you only need count number of used number for each 1..n and then...(repeat recursive approach) ONE LINE SOLUTION IN C++ ok use next permutation from STL, read how it works for other language and initialize array 11223344, and do while

[algogeeks] Re: vista crash

2009-06-22 Thread Miroslav Balaz
I think maybe someone is good at algorithm, but has no time to learn that linux stuff. I can help you, install Vista again, on that partition where there is no Mandriva, then you need tu run some LILO conf maybe is enough, you can have it from any other bootable linux CD. but i am only algorithm

[algogeeks] Re: Easy question

2009-06-03 Thread Miroslav Balaz
I know a question for genuis if P=deterministic polynomial time NP=neondeterministic polynomial time then NP-P= ? 2009/6/3 석문기 smgs2...@gmail.com Qestion is not for genius;;; Easy question . *From:* algogeeks@googlegroups.com [mailto:algoge...@googlegroups.com] *On Behalf Of *Aminooo~

[algogeeks] Re:

2009-06-02 Thread Miroslav Balaz
a + b =a(a+b) is that comutative? 2009/6/2 Arun prasath aruntendulkar2...@gmail.com 144 On Tue, Jun 2, 2009 at 3:00 PM, Aminooo~ amin...@gmail.com wrote: *Dear Friends,* * * *A question for the genius, the one who solve the problem will write the name in the attached file.* *IF;

[algogeeks] Semaphore

2009-05-31 Thread Miroslav Balaz
Does anybody know how to simulate semaphore by binary semaphore?I think it is easy, but i cant find it on internet. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] Re: Semaphore

2009-05-31 Thread Miroslav Balaz
Of course , and i didnt find it there. 2009/5/31 Ajinkya Kale kaleajin...@gmail.com did you try the wiki : http://en.wikipedia.org/wiki/Semaphore_(programming) ? On Sun, May 31, 2009 at 4:57 PM, Miroslav Balaz gpsla...@googlemail.comwrote: Does anybody know how to simulate semaphore

[algogeeks] Re: Deciding on a project

2009-05-28 Thread Miroslav Balaz
and that polygons are convex? 2009/5/25 Ralph Boland rpbol...@gmail.com On May 24, 5:05 am, Albert albert.xtheunkno...@gmail.com wrote: Hi, I'm 15 years old and I'm interested in algorithms, data structures, computational geometry and general coding. What sort of projects could I

[algogeeks] Re: Deciding on a project

2009-05-28 Thread Miroslav Balaz
Miroslav Balaz wrote: you should register on www.topcoder.com!!! and according to your skill you should try to solve some problems fromhttp://www.spoj.pl/or acm.sgu.ru Okay, but I'd like an idea of real-world programming and not just trying to solve hard problems under timed conditions

[algogeeks] Re: Deciding on a project

2009-05-28 Thread Miroslav Balaz
I thing you dont understand what we are all saying. //There are two ways how to optimise the codec. //1. disable all porn videos, and illegal movies //2. do not output anything on screen The codecs are all about mathematics, there is no programming at all... If some theory gives you an

[algogeeks] Re: Deciding on a project

2009-05-24 Thread Miroslav Balaz
you should register on www.topcoder.com !!! and according to your skill you should try to solve some problems from http://www.spoj.pl/ or acm.sgu.ru If you were from Slovakia or czech i'd recomend you www.ksp.sk 2009/5/24 Albert albert.xtheunkno...@gmail.com Hi, I'm 15 years old and I'm

[algogeeks] Re: Algorithmic challenge?

2009-05-07 Thread Miroslav Balaz
the link is not working http:// ilpubs.stanford.edu:8090/750/1/2003-29.pdf 2009/5/6 UKuser spiderc...@yahoo.co.uk As per my previous post, is there anybody who can explain section 3 to me from the PDF mentioned in this link: http://groups.google.com/group/algogeeks/t/6ccc544529b01d10 Any

[algogeeks] Re: find k-th smallest element in the set of combined m+n elements

2009-05-01 Thread Miroslav Balaz
This is very old problem, and the solution is well known. 2009/5/1 Dave dave_and_da...@juno.com This algorithm doesn't work. Try A = 2, 6, 10, 14, 18, 22, 26 and B = 4, 12, 20, 28, 36, 44, 52 with k = 6. You find x = A[6] = 22 (assuming 1-based arrays) or 26 (assuming 0- based arrays)

[algogeeks] Re: [P=NP]Algorithm

2009-04-29 Thread Miroslav Balaz
...@googlegroups.co On Tue, Apr 28, 2009 at 9:40 AM, Miroslav Balaz gpsla...@googlemail.comwrote: ok, now seriously, wtf is that? Is that in what language it is? And what does CALL DA_WRITE_HALO(A, (/CYCL, CYCL/), (/1, 1/)) When you can ask me without cussing at me I will answer you. 2009

[algogeeks] Re: [P=NP]Algorithm

2009-04-28 Thread Miroslav Balaz
ok, now seriously, wtf is that? Is that in what language it is? And what does CALL DA_WRITE_HALO(A, (/CYCL, CYCL/), (/1, 1/)) 2009/4/28 Martin Michael Musatov marty.musa...@gmail.com PROCESSORS P(NP, NP) RANGE X(N), Y(N) DISTRIBUTE X ONTO P(BLOCK, *) DISTRIBUTE Y ONTO P(*, BLOCK) SHADOW

[algogeeks] Re: after Fibonacci numbers ....

2009-04-07 Thread Miroslav Balaz
nice reasoning, but this is something for what books are. It is more numerical mathematics that algorithms for example if you want sin(f(x)) to be precise up to 100 digits, how precise should be f(x) ? 2009/4/6 alex zch051383471...@gmail.com I have got some ways to settle Fibonacci numbers

[algogeeks] Re: exact solution to this recursion equation

2009-04-01 Thread Miroslav Balaz
no that is just asymptotic recursion. the answer is between n^2 and n^2log n of coure the answer is n^2; T(n)=n^2/2-n^2/4+n^2=n^2/4+n^2=T(n/2)+n^2=by master theorem n^2 T(n) B(n)=2B(n/2)+n^2 what is by master theorem n^2 log n n n/2 n/2 n/4 n/4

[algogeeks] Re: exact solution to this recursion equation

2009-04-01 Thread Miroslav Balaz
:18 PM, Miroslav Balaz gpsla...@googlemail.comwrote: no that is just asymptotic recursion. the answer is between n^2 and n^2log n of coure the answer is n^2; T(n)=n^2/2-n^2/4+n^2=n^2/4+n^2=T(n/2)+n^2=by master theorem n^2 T(n) B(n)=2B(n/2)+n^2 what is by master theorem n^2 log n

[algogeeks] Re: Whats the solution to this problem

2009-04-01 Thread Miroslav Balaz
It is possible to do that with only O(n) invications, i answered it already to this group... 2009/4/1 DragonZsnakE dragonzsn...@gmail.com ( n cards are there initially ) we pick out the first card in random it takes n-1 comparisons to figure out its Equivalence card -n-1 steps Two

[algogeeks] Re: simple MST problm

2009-03-28 Thread Miroslav Balaz
BAN 2009/3/28 saha.dipan...@gmail.com saha.dipan...@gmail.com Please give me an algorithm for this problem--- Show that if an edge(u,v)is contained in some MST, then it is a light edge crossing some cut of the graph. i need a solution very urgently... plz help..

[algogeeks] Re: finding whether the number is prime or not ...

2009-03-23 Thread Miroslav Balaz
That is not true, there are carmichaels numbers that are 32bit..., but there is another priamlity testing algorithm, that is log n, and uses something like fermat therorem, that you can do form 2,3,5 and it works under 20 000 000. I dont remeber how the test is done, but maybe it is that you do

[algogeeks] Re: Minimum sum of matrix elements with unique row and column

2009-03-19 Thread Miroslav Balaz
Yes this is classicalproblem, it can be reduced to Min-cost max-flow. But there are other algorithms. you can find answer here http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=hungarianAlgorithm http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=minimumCostFlow1 2009/3/19, libicocco

[algogeeks] Re: Box covers and Disc Covers

2009-03-18 Thread Miroslav Balaz
I was looking in VIJAY VAZIRANI Approximation Algorithms, but from the Table of contents , it seems that such algorithm is not there. But you should try searching algortihm for finding maximal independent set of fixed sized boxes or unit sided it is somewhat dual, and there is good

[algogeeks] Re: Need Help in a new problem

2009-03-14 Thread Miroslav Balaz
of real life applications for the problem, like garbage collection, a version of postman problem, gas system construction.. I am looking for applications for the problem in networks, if any one can help. On 3/14/09, Miroslav Balaz gpsla...@googlemail.com wrote: NP what? 2009/3/13 Amina

[algogeeks] Re: which NP-complete problem can reduce to this problem?

2009-03-12 Thread Miroslav Balaz
exponent inputs are 1, 2, 3, 4, 5, 6, 7, 8 and there are so many partition problems, which maximum partition produce the result, [1,2,7,8] [3,4,5,6]? thanks Miroslav Balaz wrote: so the permanent is like determinant but without sign in summand. I have found something interesting in your

[algogeeks] Re: which NP-complete problem can reduce to this problem?

2009-03-09 Thread Miroslav Balaz
, Miroslav Balaz gpsla...@googlemail.com wrote: Do you have polynomial algorithm for that problem? We don't need one another NP-copmlete problem. There is enough of them. And there are more interresting problems for which we don't know reduction. The rule of thumb is, that if you pick random

[algogeeks] Re: hamiltonian circuit

2009-03-07 Thread Miroslav Balaz
can you also provide description of bdhg,cbg or hyperlink to them. Is this question hard? I am not graph expert. 2009/3/7 Monty praveensonare...@gmail.com the hamiltonian circuit (HC) problem remains NP-complete when restricted to chordal bipartite graphs (cbg) and becomes polynomial when

[algogeeks] Re: Binary search

2009-03-04 Thread Miroslav Balaz
of course, you cannot assume that array is in ascending order, it is in non-decreasing order however not in ascending and you should swap order here :(a[mid+1] key||mid==high) 2009/3/4 Kapil navka...@gmail.com just fixing a bug what if you write bin_search as this //assumption array is in

[algogeeks] Re: Binary search

2009-03-04 Thread Miroslav Balaz
tells n sorted array... On Wed, Mar 4, 2009 at 4:55 PM, Miroslav Balaz gpsla...@googlemail.comwrote: of course, you cannot assume that array is in ascending order, it is in non-decreasing order however not in ascending and you should swap order here :(a[mid+1] key||mid==high) 2009/3/4

[algogeeks] Re: Binary search

2009-03-01 Thread Miroslav Balaz
cout ((int)((int*)upperbound(a,a+5,k)-a))/4-1; 2009/3/1 sharad kumar aryansmit3...@gmail.com #includeiostream.h int main() { int a[5]={3,3,3,6,7}; int k; cink; int i=0,j=1,c=0; for(;i5;i++) { if(a[j-1]!=a[i] a[i]!=k) j++; else c=i; } coutc; return 0; } On Sun, Mar 1, 2009 at

[algogeeks] Re: Binary search

2009-03-01 Thread Miroslav Balaz
=mid; else if(a[mid]key) start=mid; else return mid; } int search(int a[],int key,int n) { int p=binsearch(a,0,n,key) if(p=0) while(a[p]==key) p++; return p-1; } On Sun, Mar 1, 2009 at 3:14 PM, Miroslav Balaz gpsla...@googlemail.com wrote: cout ((int)((int

[algogeeks] Re: Cards collection problem

2009-02-23 Thread Miroslav Balaz
think Mr. Balaz ? 2009/2/20 Miroslav Balaz gpsla...@googlemail.com: I thing you the only choice, is binary search tree, but it is the most obvious one. It imposible to make it independent form cards universe,as far as i know but it can be made int time O(log(nmU)),where U is number of cards

[algogeeks] Re: Cards collection problem

2009-02-18 Thread Miroslav Balaz
This is not algorithm problem, it is homework problem do it yourself. I see there one problem, and it is how large is N I suggest you to represent sets as pairs(cardID,repeat number ) that means for each card you remember number of how much you have of that card, and when there is zero, it means

[algogeeks] Re: [algogeeks]

2009-02-14 Thread Miroslav Balaz
Hmm, it is strange that you are discusing such a basic thing. You should not post your homework here, but maybe some research problems. This is so easy stuff, that many people may make mistake when explaining it. But if node has right child, then the successor is minimum of that subtree. But if

[algogeeks] Re: how the interlancers are working

2009-01-29 Thread Miroslav Balaz
I think it is secret, because the general idea is simple, but implementation is issue, because speed can be limiting factor. Maybe they use som specific aspects of language, for exmple statment delimiters like,semicolon in C++,java, or newlines in VB to simplify parsing, and error recovery. I

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Miroslav Balaz
darthcontin...@gmail.com Are you on something...? Not on TO something but ON something?? No more than 1-2 of the objects at the TOP level, and each layer is LARGER than the first. On Jan 19, 7:16 am, Miroslav Balaz gpsla...@googlemail.com wrote: LOL, according to your definition

[algogeeks] Re: post - order traversal

2009-01-18 Thread Miroslav Balaz
you will use stack, and you have 2 kind of values in stack, one is visit node first time, and second is wisit node for second time when first time: you put visit this node for second time and then you put visit nododes for first time to stack for all descendands when second time: you calculate

[algogeeks] Re: Lucky numbers

2009-01-08 Thread Miroslav Balaz
OK, I think the only known solution is that trivial, it can be proved that it have complexity of O(sqrt(n)), solution k=2 iterate { if(k divides n) return unlucky if(kn) return lucky; n=n-n/k; k=k+1; } after x iteration the n will be at most n/x; 2009/1/7 Miroslav Balaz gpsla...@googlemail.com

[algogeeks] Re: Lucky numbers

2009-01-07 Thread Miroslav Balaz
ok that was bullshit, the number of lucky numbers is about 10^9 2009/1/7 Miroslav Balaz gpsla...@googlemail.com You should generate all the lucky numbers, less than 10^18, there shouldy not many of them. maybe 50. And then just submit program using hardwired array. 2009/1/6 Rahul Kushwaha

[algogeeks] Re: Lucky numbers

2009-01-07 Thread Miroslav Balaz
You should generate all the lucky numbers, less than 10^18, there shouldy not many of them. maybe 50. And then just submit program using hardwired array. 2009/1/6 Rahul Kushwaha rahul.kushw...@gmail.com can anybody tell me which is best and correct solution On Tue, Jan 6, 2009 at 12:30 AM,

[algogeeks] Re: find the output

2009-01-06 Thread Miroslav Balaz
the code is wrong and unsafe, because you use char buffer[MAX], what is local varieable defined on stack. it is only valid while the modify procedure is executing You only have the option to use global or static variable, or second parameter, or allocate memory on your own using new, or malloc

[algogeeks] Re: League Scheduling Problem

2008-12-16 Thread Miroslav Balaz
:37 am, Miroslav Balaz gpsla...@googlemail.com wrote: i think that, you could just simulate the tournament, ande before each weak you sort players by number of played matches, and if this numer is same then by name. And after you have them sorted,you just assign an oponent to first player

[algogeeks] Re: Q: TSP with 2-edge cost definition?

2008-12-16 Thread Miroslav Balaz
Of course it is , because both problems are NP-COMPLETE. But the transformation is non-trivial, it only comes from the definition fo NP-Completeness 2008/12/16 Golabi Doon golabid...@gmail.com Hello folks, I am trying to solve a non-standard TSP problem with no success so far. I would

[algogeeks] Re: League Scheduling Problem

2008-12-11 Thread Miroslav Balaz
i think that, you could just simulate the tournament, ande before each weak you sort players by number of played matches, and if this numer is same then by name. And after you have them sorted,you just assign an oponent to first player, in such way that you choose the one the first one with whom

[algogeeks] Re: bank card problem

2008-12-11 Thread Miroslav Balaz
i think it will not perform good, if you have cards like this 1 2 3 4 5 5 5 5 the supposed solution is, keep one counter and one candidate first , the candidate is the first element, and counter is 1 if the next card equals candidate increase the count to 1, else decrease it if counter is zero you

[algogeeks] Re: bank card problem

2008-12-10 Thread Miroslav Balaz
ok, and when n is not even, you need to test explicitly the last element with the whole cards. 2008/12/10 Miroslav Balaz [EMAIL PROTECTED] I thik it is wll known classical problem,or there is some similar well known problem, you need O(n) comparisons. Randomized pick eight random cards

[algogeeks] Re: bank card problem

2008-12-10 Thread Miroslav Balaz
I thik it is wll known classical problem,or there is some similar well known problem, you need O(n) comparisons. Randomized pick eight random cards and compare then to each other. and you have very low probabilty that you always choose bad card. Deterministic. just compare 1 and second, third and

[algogeeks] Re: Fastest Method to implement graphs in C++

2008-12-08 Thread Miroslav Balaz
Fibbonaci heaps are not the fastest way in practice, they are only theoreticaly faster for large enough n. I heard about some techniques where they are only integer numbers. 2008/12/7 TheTravellingSalesman [EMAIL PROTECTED] I was about to start implemening max flor min cut and shortest path

[algogeeks] Re: Hoare-Partition, Cormen

2008-11-27 Thread Miroslav Balaz
you are mistaken, you dont understant do repead until semantics until stops the loop when expresions is TRUE 2008/11/27 Roman Yakovenko [EMAIL PROTECTED] Hi. Second edition of Introduction to Algorithm defines the following algorithm HOARE-PARTITION(A, p, r) 1 x ← A[p] 2 i ← p - 1 3

[algogeeks] Re: Covering grid with pentominoes - duplicated solutions

2008-11-26 Thread Miroslav Balaz
it is possible to avoid duplicate solution, but i dont know if it is the same effective, and i am not sure if it is correct; you consider first coordinates in row mayor order, and first uncovered cell must be covered by some top left corener of remaining pentomino. from here i am not sure if you

[algogeeks] Re: Covering grid with pentominoes - duplicated solutions

2008-11-26 Thread Miroslav Balaz
On Wed, Nov 26, 2008 at 4:03 PM, Geoffrey Summerhayes [EMAIL PROTECTED]wrote: On Nov 25, 6:34 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I'm trying to write an algorithm counting all possible ways (symmetry included) a grid of dimensions NxM can be covered with a prescribed

[algogeeks] Re: Covering grid with pentominoes - duplicated solutions

2008-11-26 Thread Miroslav Balaz
, and the algorithm never generates the same vector twice On Wed, Nov 26, 2008 at 9:27 PM, Geoffrey Summerhayes [EMAIL PROTECTED]wrote: On Nov 26, 1:40 pm, Miroslav Balaz [EMAIL PROTECTED] wrote: It is too slow, i replied with better solution , bu i dont know how this forum works. I

[algogeeks] Re: Backtracking algorithm

2008-11-06 Thread Miroslav Balaz
I dont thing if that problem is requiring backtracking algorithm, pleas try better description of the real case. how are those sets defined? if they are defined by enumerating its elements, you can compute intersection in O(n) if they are sorted. On Thu, Nov 6, 2008 at 2:32 PM, Luciano Pinheiro

[algogeeks] Re: Backtracking algorithm

2008-11-06 Thread Miroslav Balaz
for eash ith person in this tree. Thank's You. 2008/11/6 Miroslav Balaz [EMAIL PROTECTED]: I dont thing if that problem is requiring backtracking algorithm, pleas try better description of the real case. how are those sets defined? if they are defined by enumerating its elements, you

[algogeeks] Re: exponential algorithms NP problems ?

2008-11-05 Thread Miroslav Balaz
Because NEXP means non-deterministic exponecial , what is another class of problems, but NEXP problems are not so common in practice tahn NP problems. The answer to your question is that, because for each NP problem there exist deterministic polynomial time algorithm, that can verify whether a