subject

Uluthando needs your help to plant some trees. He can give you three parameters of the land: - width of the land w - length of the land l - gap between the trees g You have to create an algorithm to return the number of trees which can be planted on the edges of the given land in a symmetrical layout shown below (unsymmetrical gap = x, tree = o, gap = -): w=3, l=3, g=1 plantTrees(w, l, g) ➞ 4 o - o - - o - o // Uluthando can plant 4 trees. w=3, l=3, g=3 plantTrees(w, l, g) ➞ 2 o - - - - - - o // Uluthando can plant 2 trees. If the layout is not symmetrical, you have to return 0: w=3, l=3, g=2 plantTrees(w, l, g) ➞ 0 o - - x o x x x // Planting 2 trees mean the gap of two trees will be greater than 2. o - - x o o - - // Planting 3 trees mean the gap of two trees will be less than 2. Another Example for better understanding: w=3, l=3, g=0 plantTrees(w, l, g) ➞ 8 o o o o o o o o // Uluthando can plant 8 trees. ​

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
1. you have a small business that is divided into 3 departments: accounting, sales, and administration. these departments have the following number of devices (computers, printers, etc.): accounting-31, sales-28, and administration-13. using a class c private network, subnet the network so that each department will have their own subnet. you must show/explain how you arrived at your conclusion and also show the following: all available device addresses for each department, the broadcast address for each department, and the network address for each department. also, determine how many "wasted" (not usable) addresses resulted from your subnetting (enumerate them).
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
An ou structure in your domain has one ou per department, and all the computer and user accounts are in their respective ous. you have configured several gpos defining computer and user policies and linked the gpos to the domain. a group of managers in the marketing department need different policies that differ from those of the rest of the marketing department users and computers, but you don't want to change the top-level ou structure. which of the following gpo processing features are you most likely to use? a, block inheritance b, gpo enforcement c, wmi filtering d, loopback processing
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
You know the right answer?
Uluthando needs your help to plant some trees. He can give you three parameters of the land: - width...
Questions
question
Mathematics, 04.09.2020 23:01
question
Mathematics, 04.09.2020 23:01
question
Mathematics, 04.09.2020 23:01
question
Geography, 04.09.2020 23:01