Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
solve the problem in java:
Consider the are n=2 subjects and needed =[4,5]
answered questions, to pass.
The student has answered =[2,4] questions in the two subjects so far, and can answer another q=1 questions across all subjects combined. The best outcome is to answer an additional question in the second subject on order to pass it, as 2 more answers required to pass the first subject. the max number of subject s that can be passed is 1.
the function must return an integer that can represent the max number of subjects that can be passed.
public static int maxNumsub(List <Integer> answered, List<Integer> needed, int q)
{
//write code here
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Similar questions
- Let's revisit our first problem, where we want to set up a series of chess matches so we can rank six players in our class. As we did before, we will assume that everyone keeps their chess rating a private secret; however, when two players have a chess match, the person with the higher rating wins 100% of the time. But this time, we are only interested in identifying the BEST of these six players and the WORST of these six players. (We don't care about the relative ordering or ranking of the middle four players.) Your goal is to devise a comparison-based algorithm that is guaranteed to identify the player with the highest rating and the player with the lowest rating. Because you are very strong at Algorithm Design, you know how to do this in the most efficient way. Here are five statements. A. There exists an algorithm to solve this problem using 6 matches, but there does not exist an algorithm using only 5 matches. B. There exists an algorithm to solve this problem using 7 matches,…arrow_forwardWhat Python code will solve the following: The goal of this section is to estimate the probabilities Pij (transition probabilities) associated with finding food from any location (i, j) inside the maze. A rat will be considered successful in finding food if the probability of finding food from a given location exceeds 0.5. 1. Use Equation (1) to write down equations for each probability Pij for i = 1, 2, · · · , 6, j = 1, 2, 3, · · · , 5. Equation 1 is : Pij = 1/4Pi-1j + 1/4 Pi+1j +1/4 Pij-1 + 1/4Pij+1 2. Notice that your equations constitutes a system of linear equations with 30 equations and 30 unknowns, with the unknowns as the transition probabilities. Identify the coefficient matrix for the system of equations and write your system in the form Ap = b, where b is some constant vector and p the vector of transition probabilities, ordered from the upper left hand corner of the maze to the lower right hand corner. The goal is to solve the system for p. 2 3. How would you characterize…arrow_forward
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education