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
Igoryamba
3 years ago
13

There are generally two ways of implementing dynamic programming solutions to problems, which have equal asymptotic time complex

ities. (The details of the problem may determine which is better in a given situation). What are they?
Select two:
1) Bottom-up
2) Left-to-right
3) Right-to-left
4) Top-down
Computers and Technology
1 answer:
san4es73 [151]3 years ago
8 0

Answer:

1) Bottom-up

2) Top-down

Explanation:

In general dynamic programming is a divide and conquer strategy which can be implemented using bottom up approach or top down approach.

Bottom-up approach in dynamic programming will solve a relatively simple sub-problem first and then use the solution to build and arrive at solutions to a bigger sub-problem.

Top down approach is reversed to bottom-up approach and is also known as Memoization Method. Instead of solving a problem started from the base state sub-problem, the top down approach break a problem into a smaller problems from the top most destination state until it reaches the bottom most base state.

You might be interested in
Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences
Nitella [24]

Answer:

//Method definition

//Method receives a String argument and returns a String value

public static String removeDuplicates(String str){

       //Create a new string to hold the unique characters

       String newString = "";

       

       //Create a loop to cycle through each of the characters in the

       //original string.

       for(int i=0; i<str.length(); i++){

           // For each of the cycles, using the indexOf() method,

           // check if the character at that position

           // already exists in the new string.

           if(newString.indexOf(str.charAt(i)) == -1){

               //if it does not exist, add it to the new string

               newString += str.charAt(i);

           }  //End of if statement

       }   //End of for statement

       

       return newString;   // return the new string

   }  //End of method definition

Sample Output:

removeDuplicates("bookkeeeeeper") => "bokeper"

Explanation:

The above code has been written in Java. It contains comments explaining every line of the code. Please go through the comments.

The actual lines of codes are written in bold-face to distinguish them from comments. The program has been re-written without comments as follows:

public static String removeDuplicates(String str){

       String newString = "";

       

       for(int i=0; i<str.length(); i++){

           if(newString.indexOf(str.charAt(i)) == -1){

               newString += str.charAt(i);

           }

       }

       

       return newString;

   }

From the sample output, when tested in a main application, a call to removeDuplicates("bookkeeeeeper") would return "bokeper"

7 0
2 years ago
What are the two categories of problems that we can simply convert<br> to parallel code?
anastassius [24]
Percentage and decimals
7 0
3 years ago
Define power supply and types of power supply<br>​
emmainna [20.7K]

Answer:

hope you like it

Explanation:

Two types of power supplies exist, DC-DC and AC-DC. DC-DC power supplies allow you to plug in electrical devices into car outlets or similar sources that supply direct current, or DC, power. These power supplies are not the most commonly used, though.

Classification of Power Supply and Its Different Types

OUTPUT = DC OUTPUT = AC

INPUT = AC Wall wart Bench power supplies Battery charger Isolation transformer Variable AC supply Frequency changer

INPUT = DC DC-DC converter Inverter Generator UPS

4 0
2 years ago
When performing actions between your computer and one that is infected with a virus, which of the following offers No risk of yo
daser333 [38]

Answer:

d

Explanation:

7 0
3 years ago
Which of these standards has the fastest connection?
leonid [27]

Answer:

802.11ac is fastest cinnection

7 0
2 years ago
Other questions:
  • What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
    9·2 answers
  • You can use ___________ to add dynamic features to a webpage such as search box that completes your search text automatically.
    12·1 answer
  • According to the author, there are five hedging strategies organizations can pursue. One of them is: Select one: a. commit with
    5·1 answer
  • Targeting encourages drivers to scan far ahead and _____________. A. focus their visual attention on the next point on the road
    8·2 answers
  • Write a shell script called SpellOutDate that prints the detail of the current date in separate lines. For example if the curren
    13·1 answer
  • Converting raw data into a more meaningful form is called:
    6·1 answer
  • What factor(s) should be considered when determining whether a business is too far based on the query and the user location? Sel
    10·1 answer
  • The metric unit used for length
    5·1 answer
  • Question 5 of 10
    10·1 answer
  • Write a program to demonstrate circular linked list with operations using pointers – insert
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!