answer.
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
guapka [62]
1 year ago
10

1- Design a brute-force algorithm for solving the problem below (provide pseudocode): You have a large container with storage si

ze: W lb. You have many Items (n) where each item weight is: wi. the algorithm you design should find the subset of items with the largest weight not exceeding W (Container storage capacity)
2- Submit a simple program in Java that implements your algorithm with an example test run.
Computers and Technology
1 answer:
sladkih [1.3K]1 year ago
3 0

Answer:

Pseudocode is as follows:

// below is a function that takes two parameters:1. An array of items 2. An integer for weight W

// it returns an array of selected items which satisfy the given condition of sum <= max sum.

function findSubset( array items[], integer W)

{

initialize:

maxSum = 0;

ansArray = [];

// take each "item" from array to create all possible combinations of arrays by comparing with "W" and // "maxSum"

start the loop:

// include item in the ansArray[]

ansArray.push(item);

// remove the item from the items[]

items.pop(item);

ansArray.push(item1);

start the while loop(sum(ansArray[]) <= W):

// exclude the element already included and start including till

if (sum(ansArray[]) > maxSum)

// if true then include item in ansArray[]

ansArray.push(item);

// update the maxSum

maxSum = sum(ansArray[items]);

else

// move to next element

continue;

end the loop;

// again make the item[] same by pushing the popped element

items.push(item);

end the loop;

return the ansArray[]

}

Explanation:

You can find example to implement the algorithm.

You might be interested in
In computing, a(n) _____ is an attack on an information system that takes advantage of a particular system vulnerability. Select
tensa zangetsu [6.8K]

Answer: d) Exploit

Explanation: Exploit is a type computer attack that successful when the computer system of an user is vulnerable and attacker can do the exploitation. This happens due to the weakness of the system, applications software, network etc.

Other given option are incorrect because exit door,glitch and bad are not any type of attack in the computer field that causes harm to the system.Thus the correct option is option(d).

4 0
1 year ago
In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player
Assoli18 [71]

Answer:

С The player had 3 bonus round attempts and 7 of them earned extra points.

Explanation:

Given

See attachment for correct code segment

Required

Which of the options is not possible?

From the question, we understand that:

attempts \to [1,4] --- attempt can only assume values 1, 2, 3 and 4

The following "if statement" is repeated three times

<em>IF RANDOM[1,10] <= 7:</em>

<em>    success = success + 1</em>

This implies that the maximum value of the success variable is 3

The first printed value is the attempt variable

The second printed value is the success variable.

From the list of given options, (a), (b) and (d) are within the correct range of the two variable.

While (c) is out of range because the value printed for variable success is 7 (and 7 is greater than the expected maximum of 3)

8 0
1 year ago
A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
Butoxors [25]

Apply encryption to VM files the following steps should be taken to secure the VMs so no user can copy or delete another user's VM files

f. Apply encryption to VM files.

b. secure the VM files with permissions

<u>Explanation:</u>

Installing anti-malware is a must on each VM OS OR Host OS to protect both servers and hosted workstations.

Scheduling update OS patches and anti-malware and scanning server or host operation are also must.

Securing VM files as best practices better to encrypt and decrypt is the best method or best practices.

Even protected VM files sometimes can be hacked and damaged the VM files.

VM is a virtual machine technology is used in windows 10. Before login decrypts the VM and connects to virtual machines. On disconnected encrypted is safer.

5 0
1 year ago
1. Which of the following are considered CAD powerhouses?
allsm [11]

Answer:

1. D.Autodesk and microstation.

2. D. the creation of a computer model, paricularly for purposes of studying.

3. A.internet delivered through standard household phone lines.

4. C.3-D sculptures used to pray for fertility.

5. C.technology.

Explanation:

8 0
1 year ago
Middleware for cloud database applications is commonly written as ____—short sections of code written in a programming or script
Ostrovityanka [42]
<span>Middleware for cloud database applications is commonly written as scripts—short sections of code written in a programming or scripting language that are executed by another program. A script language is used for server side scripting language that can change a specific data on the server. Examples of these are PHP, JSP, Perl, Python, etc.</span>
5 0
2 years ago
Other questions:
  • Which task can a company perform with intranets?
    9·2 answers
  • The tuna marketers' task in the "tunathewonderfish.com" website and related campaign was to ________.
    15·1 answer
  • To keep from overwriting existing fields with your Lookup you can use the ____________ clause.
    14·2 answers
  • Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
    11·1 answer
  • When ____ occur during preliminary debugging, dummy print statements—statements that are temporarily inserted into the code to d
    9·1 answer
  • Samuel received an email that looked like it came from his bank. The email told him to click a link that opened an official look
    7·1 answer
  • You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
    8·1 answer
  • Which statement accurately describes the clutter feature in outlook 2016
    12·1 answer
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!