subject

Translate the following pseudocode for randomly permuting the characters in a string into a C++ program. Read a word.
Repeat word. length[] times
Pick a random position i in the word.
Pick a random position j > in the word.
Swap the letters at positions j and i.
Print the word.
To swap the letters, construct substrings as follows:
first i middle j last
Then replace the string with
first + word. substr(j,1) + middle+ word. substr(i,1) + last

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
Advantages and disadvantages of binary system
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
Translate the following pseudocode for randomly permuting the characters in a string into a C++ prog...
Questions
question
Mathematics, 18.03.2021 21:50
Questions on the website: 13722360