Danzev's blog

By Danzev, history, 3 years ago, In English

Do you know some unexpected and interesting applications of these hamiltonian and eulerian cycles/paths? For example, I have recently learnt about string reconstruction as an eulerian path problem and I was suspised a bit.

So, do you know something similar else?

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

By Danzev, history, 4 years ago, In English

Given an array $$$a_1,a_2,\dots,a_n$$$, $$$a_i=i$$$ and a permutation of this array $$$p_1,p_2,\dots,p_n$$$. We sort this permutation to get initial array using bubble sort.

Question: how to calculate a number of swaps in $$$O(n)$$$ instead $$$O(n^2)$$$?

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it