| |

VerySource

 Forgot password?
 Register
Search
Author: dirtydog

Array element transposition algorithm

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Japan

Post time: 2020-7-27 19:30:01
| Show all posts
Does this question mean shifting the array right n-k bits or left k bits?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-29 23:00:01
| Show all posts
This question can refer to the introduction in the book "Programming Pearls". There should be a positive answer.
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-30 07:15:02
| Show all posts
Sorry, my method is BUG. When n%k>1 or n%(n-1-k)>1, disorder will appear! Hey~~ What a failure!
Reply

Use magic Report

0

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-7-30 11:00:02
| Show all posts
Yes, there is an effective algorithm in Programming Pearls.
I feel that the algorithm introduced in "Programming Pearls" is quite good :)
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-2 23:30:02
| Show all posts
aog777ysis awesome!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list