Following is the details of items in the store:
Items ={a, b, c ,d, e}
Weight ={4, 3, 2, 5, 6 }
Price =<last five digits of your Registration No and add 5, 7, 3, 2, 4 to the respective digit> (Example: suppose your registration number is 11912356 then price will be like 1+5, 2+7, 3+3, 5+2, 6+4 )
Size of the bag =13
Select the items from the store such that you earn the maximum profit. (Use 0/1 Knapsack technique to solve it).(Neatly show all the steps and also write the algorithm)(Apply the bottom-up approach to find the optimal solution)(Analyze the running time of the given problem)
Find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is as follows:
Matrix Dimension
A1 10 × 15
A2 15 × 25
A3 25 × 8
A4 8 × 13
A5 13 × 10
Sort the given sequence of numbers using Bubble sort. Write all the
steps involved. 13, 15, 2, 6, 14, 10, 8, 7, 3, 5, 19, 4.
Find an optimal solution for the knapsack instance n=6 and M=13,
(p1 , p2 ,..., p6 )=(8, 5, 13, 7, 6, 15)
(w1 , w2 ,..., w6 )=(3, 2, 4, 6, 2, 5)
While dealing with the negative edge weights, the Dijkstra’s algorithm is not considered best. Explain the alternate suitable algorithm for single source shortest path with an example.
Using the Rabin Karp algorithm, find the pattern string in the given text. Pattern: “fed”, Text: “acfeddadfdec”. Write all the steps involved.
Write an assembly program using MARIE's assembly Instruction set that prompts the user to enter a non-negative integer that is less than 10. The program should include a subroutine that keeps prompting until a valid value is obtained. When a valid number is entered, it will be displayed. (Hint: Use JNS & JUMPI instructions to implement the subroutine) N.B: You should include the MARIE code in your Answer, with an explanation of each instruction in your code beside it (not a screenshot!). Example: Subt One /Subtract 1 from AC Your included code should be ready to be tested by your instructo
Q1. Draw the logic diagram, logic expression, the timing diagram and truth table of the output for a simple car alarm system.
Q2. Discuss the Logic Diagram in Q1 and reduce the logic expression to its simplest form if possible
Create an application that will display a multiplication table number entered by a user. The program must display the first five multiplication values
Melokuhle is a very young intelligent and adventurous individual. He has recently
bought 4 quantums (taxi) to transport people around the country. As a result, he is
planning a trip to Upington.
Therefore, he has hired you to write a program in pseudocode as well as in C++ to
evaluate the fuel consumption on his 4 cars during the planned trip. The kilometers
and fuel level in the tank at the start and end of the journey should be entered by the
end-user.
Calculate for each car, the fuel used, kilometers traveled, and the overall fuel
consumption in kilometers traveled per litre of fuel.
NB write an algorithm and a code in C++