1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mote1985 [20]
3 years ago
12

A shuffle of two strings X and Y is formed by interspersing the characters into a new string, keeping the characters of X and Y

in the same order. For example, the string BANANA ANANAS is a shue of the strings BANANA and ANANAS in several different ways.
BANANAANANAS BANANAANANAS BANANANANA

Similarly, the strings PRODGYRNAMAMMIINCG and DYPRONGARMAMMICING are both shuffles of DYNAMIC and PROGRAMMING:

PROGRAMMING PROGRAMMING

Describe and analyze an efficient algorithm to determine, given throe strings A1 [1...m], B [1...n] and C[1...m+n], whether C is a shuffle of A and B.
Computers and Technology
1 answer:
levacccp [35]3 years ago
3 0

Shuffle (A[1..m], B[1..n], C[1..m+n]):

Shuf[0, 0] ← True

for j ← 1 to n

Shuf[0, j] ← Shuf[0, j − 1] ∧ (B[j] = C[j])

for i ← 1 to n

Shuf[i, 0] ← Shuf[i − 1, 0] ∧ (A[i] = B[i])

for j ← 1 to n

Shuf[i, j] ← False

if A[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i − 1, j]

if B[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i, j − 1]

return Shuf[m, n]

The algorithm runs in O(mn) time.

You might be interested in
an early type of GUI is created, which includes windows, pop-ups, icons, and menus. What year did this happen? Please help!!! qu
Dahasolnce [82]

Answer:

1979

Sources:

Wired

InventHelp

hope i helped :D

3 0
3 years ago
Answer this correct and get brainly
Leya [2.2K]

Pseudocode:

import random

fetch user input on a lucky number

insert input into variable - "response"

new variable, random = randint

condition to check wheather random is our response

display results

Python Code:

import random

def main():

response = int(input("Guess my lucky number, its between 1 and 100: "))

lucky_number = random.randint(1,100)

if response == lucky_number:

print(f"Wow you're right, it is {lucky_number}")

else:

print("Sorry, Try Again")

main()

Reminder:

intended for python3 as i included the format f

also it could be done without the import, just manually insert a number

i'll leave the post mortum to you

5 0
2 years ago
Read 2 more answers
A program requires a variable to store an integer value of 3000000000. Which of the following statements can be used?
Anastasy [175]

22222222Explanation:

8 0
3 years ago
A(n) ___ mals each search key into a different integer that is suitable as an index to the hash table
tigry1 [53]

Answer:C )Hash index

Explanation:Hash index is the index format that contains the  group of the  array in the organized pattern. In the hash table, the function of the hash index is to fix the index keys along with the buckets.

Hash index malware is used for the index keys which will correspond to the  integers which are of the different  from the actual integers in the hash table.Therefore, the correct option is option(c).

5 0
3 years ago
WILL MARK FIRST ANSWER BRAINLIEST!!
Effectus [21]

Answer:

The message will remain in Manny's outbox until the computer is started and the Outlook program is started the next day.

8 0
3 years ago
Other questions:
  • How is abstraction used in a GPS system
    9·2 answers
  • 5. Drawing Conclusions If you were a person in
    10·1 answer
  • ____________ refers to the computer-to-computer transmission of business data in a structured format.
    15·1 answer
  • The CEO of CorpNet.xyz has hired your firm to obtain some passwords for their company. A senior IT network administrator, Oliver
    8·1 answer
  • Evaluate each condition as to whether it is true or not.
    6·1 answer
  • Elsa wants to save her work at the office to be continued at home either on a pen drive or CD. Outline three reasons why she wil
    13·1 answer
  • What is the output of the following program?
    8·1 answer
  • Question 1 of 10
    15·1 answer
  • Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and
    9·1 answer
  • Design a finite automata from regular expression 10(0+11)0*1
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!