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
2.4 Code Practice: Question 2
klasskru [66]

num = float(input("Enter a number: "))

num1 = int(num)

print(num - num1)

I hope this helps!

8 0
2 years ago
Which of the following best describes the protocols used on the Internet?
max2010maxim [7]

Answer:

D: The protocols of the Internet are open and used by all devices connected to the network

Explanation:

There are billions of devices connected to the Internet, and hundreds of different kinds of devices: laptops, tablets, phones, refrigerators, handheld credit card readers, and so on. Protocols (standards) ensure that the variety of devices interact with each other smoothly.  There are a lot of protocols! The Internet was designed with several layers of abstraction that sort the protocols according to what part of the process they support.

5 0
3 years ago
Which of the following is a valid IP address that can be used on the Internet (meaning the public addressing scheme)? Group of a
VladimirAG [237]

Answer:

168.16.1.1 is correct.

Explanation:

168.16.1.1 is the legitimate Internet Protocol address that can be used on the Internet.

Internet Protocol 10.10.1.1 and internet Protocol 172.30.1.1 are the private internet protocol addresses so they could not be used on the internet.

The Internet Protocol 234.1.1.1 has been used as a multicast address so they may not be used on the Internet.

7 0
3 years ago
Only the root user can modify a file that has the immutable attribute set.
Vladimir79 [104]
False if the roots modify it’s capable of it’s attributed set
8 0
1 year ago
How to recover permanently deleted files from drive
HACTEHA [7]
Go into your trash bin in your computer.
7 0
3 years ago
Other questions:
  • The more resources you have to choose from during an open book test, the better you will do on the test because more
    13·1 answer
  • Why you should care about copyright
    13·1 answer
  • One of the most common uses of spreadsheet programs are communicating with others. O editing images and photos. O tracking and m
    8·2 answers
  • The process known as "bitmapping" is defined as information in _____. PLEASE HELP FAST
    11·1 answer
  • Four differences between fourth and fifth generation of computers​
    12·1 answer
  • I have been charged for brainly plus yet I still have to watch ads why? What do I do?
    12·2 answers
  • What are advantages of using document templates?
    13·2 answers
  • A file name extension provides what information about a file?
    6·1 answer
  • Advantages and disadvantages of java
    10·1 answer
  • El botón de layout se usa para <br>​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!