Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

There are numbers from 1 to n, which are inverted such that
it results in numbers from n to 1. If only two consecutive
numbers are stampled at a time and are inverted, how many
moves are required?

Answer Posted / venomvendor

Answer is

Sigma(count), where count ranges from [1 to {n-(swap per time -1)}]

n-(swap per time - 1)
&#931; i
i=1

Image Notation >> http://imgur.com/6HkcXzP

In this case.
n = n
swap per time = 2

Substituting this, we get

n-(2 - 1)
&#931; i
i=1

n-1
&#931; i
i=1

1+2+3+ . . . + (n-1)

if n = 5
Total swaps would be

1+2+3+4 = 10

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Routing Algorithm?

1057


What are the complexities of sorting algorithms and how can this complexity be calculated?

1028


What is bidirectional search algorithm?

1166


Which search algorithm will use a limited amount of memory in online search?

1143


What is simulated annealing algorithm?

1124


Can you pick an algorithm. Write the psuedo-code for a parallel implementation?

904


Which algorithm in ‘unification and lifting’ takes two sentences and returns a unifier?

968


What is the iterative deepening depth-first search algorithm?

1016


What is breadth-first search algorithm?

953


can anyone help me with some suggestions and improvemnts for sage line 50?

2544


what is software cycle?give a diagramatic representation

2590


What do you mean by overfitting and underfitting algorithms?

1026


Sorting algorithms and time complexity of various algorithms.

1012


What is greedy best first search algorithm?

1024


What’s your favorite algorithm, & can you explain it into me in less than a minute?

1231