Re: [algogeeks] Re: SPOJ PROBLEM

2011-02-18 Thread Jhosimar Arias
Infinity in c++ you can use this -> std::cout << std::numeric_limits::infinity ()< > hi, > > i have a slightly different but related probelm, i am trying to implement > djiktra's in c++ & how should i deal with the infinity weights( i mean does > c++ have infinity)? > > thanx in advance :) > > >

Re: [algogeeks] m-permutation

2011-02-09 Thread Jhosimar Arias
This is a josephus problem, using a circular linked list takes cuadratic time O( m n ), I think the josephus problem can be solved using rank trees in O(n log n). Construct a rank tree from an array with n elements storing the elements in a binary tree in in-order sequence ( Constructor ). Store i