Ummm what are you trying to ask? Is it like a error on your computer or-
Answer:
The method in Java is as follows:
public static ArrayList<Integer> appendPosSum(ArrayList<Integer> nums) {
int sum = 0;
ArrayList<Integer> newArr = new ArrayList<>();
for(int num : nums) {
if(num>0){
sum+=num;
newArr.add(num); } }
newArr.add(sum);
return newArr;
}
Explanation:
This defines the method; it receives an integer arraylist as its parameter; nums
public static ArrayList<Integer> appendPosSum(ArrayList<Integer> nums) {
This initializes sum to 0
int sum = 0;
This declares a new integer arraylist; newArr
ArrayList<Integer> newArr = new ArrayList<>();
This iterates through nums
for(int num : nums) {
If current element is greater than 0
if(num>0){
This sum is taken
sum+=num;
And the element is added to newArr
newArr.add(num); } }
At the end of the iteration; this adds the calculated sum to newArr
newArr.add(sum);
This returns newArr
return newArr;
}
In the case above, the operation is not efficiently supported by heaps is Find.
<h3>What are heap operations?</h3>
The operation that are known to often use heaps are:
- Heapify
- Find-max (or Find-min)
- Insertion, etc.
Therefore, In the case above, the operation is not efficiently supported by heaps is Find.
See full question below
Which operation is not efficiently supported by heaps?
a. DeleteMin
b. Find
c. FindMin
d. Insert
e. all of the above are sufficiently supported
Learn more about operation from
brainly.com/question/24214198
#SPJ11
Answer:
it's actually complicated
ifctxoycpyypg
Answer:
Latex replaced wax because it did the same thing and was used for the same things that wax would be used for
Explanation: