1
$\begingroup$

How can I reversibly combing two very large numbers, such as 9,828,485,546,536,174,656,640,115,183 and 43,044,700,185? I need them to be combined into a single number, and the order of the numbers must be remained intact, so being required to flip them would be unfavorable, but I could just add a 0 or 1 at the front or end to specify whether or not the numbers had been flipped if I had too.

$\endgroup$
1
$\begingroup$

See this prior question on pairing functions, e.g. the classical Cantor pairing or another "elegant" one useful for depth-first ordering.

$\endgroup$
  • $\begingroup$ Neither the elegant, nor the cantor pairing functions work for numbers this large. $\endgroup$ – khan Aug 14 '18 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.