GradePack

    • Home
    • Blog
Skip to content

BIOL 2404 lab final exam15.jpg

Posted byAnonymous October 1, 2025October 2, 2025

Questions

BIOL 2404 lаb finаl exаm15.jpg

The rаndоm vаriаble X represents the number оf classes a student skipped. The prоbability distribution for this scenario is shown below. Number of Classes p(x) 0 0.21 1 0.38 2 0.34 3 0.05 4 0.02   The probability that a randomly selected student skipped exactly 2 classes is Event A.  The probability that a randomly selected student skipped at most 1 class is Event B.  The probability that a randomly selected student skipped more than 2 classes is Event C. Find the average number of skipped classes for this population. 

The depаrtment requires аll students enrоlled in this cоurse tо pаrticipate in research projects. Which of the following statements is true?

Prоfessоr Amаn hаs spent yeаrs researching the beauty оf binary trees, specializing in the art of adding up node values. With each node containing a number, and the potential to contain a left and right subtree, the total value of the tree can reach great heights! Despite this, he is quite picky about which nodes to add to the precious total... Professor Aman only adds the values of the outermost nodes, which are the left-most and right-most nodes at each level. As his handy dandy research assistant, you must solve the following assignment: Given the root of a binary tree, write a function in C++ that returns the sum of the values of the outermost nodes of each level in the tree. If there is a single node in a level, you should only include its value once. If the tree is empty, return 0. Start off with this function header: int sumOutermostNodes(TreeNode* root) {   // your code here} Input Constraints: All node values are >= 1. All node values are unique. Example Input: Example Output: 54 -> add 2 + (5 + 7) + (1 + 9) + (14 + 6) + 10 Optional: You can test your code at these locations: https://www.onlinegdb.com/ or https://cpp.sh/ 

We аll knоw аnd lоve the clаssic rubber ducks (rubber duck debugging, anyоne?). But now, we've thrown them into a magical river that makes them disappear under certain conditions! (conditions are described below) You are given a vector ducks of integers representing the ducks as they are ordered in the river. That is, the index of each duck in the vector represents its position in the river. For each duck, the absolute value represents its size and its sign represents its direction (positive means right, negative means left). Each duck is moving at the same speed, meaning ducks moving in the same direction will never meet. No duck will have a value of 0. It is possible for two ducks moving in opposite directions to collide. When this occurs, the smaller of the two ducks (by size) will be disappeared (removed) from the river, and the larger will remain (moving in the same direction as before the bump). If both ducks are the same size, the bump will make them both disappear! (Magical rivers amirite?) Return a list of the ducks that remain in the river after all collisions occur, with order preserved. That is, if duck1 is before duck2 in the input vector and both ducks survive, then duck1 should be before duck2 in the output vector. Constraints: Each duck will be less than 0 or greater than 0. A duck will never have a value of 0. Examples: Input: [3, 10, -2]Output: [3, 10]Explanation: The zeroth duck and the first duck are moving in the same direction. The first duck and the second duck are moving in opposite directions (note how the signs are different). The first duck and the second duck will meet and since the absolute value of the first duck is larger than the second one, the first duck will absorb the second one. Input [-9, 2]Output: [-9, 2]Explanation: Since the zeroth duck is moving to the left and the first duck is moving to the right, no one will bump! Input: [9, -9]Output: []Explanation: These ducks bumped and since their absolute values are equal, they disappeared! Input: [7, 3, -12]Output: [-12]Explanation: The zeroth duck and the first duck are moving in the same direction. The second duck is moving in the opposite direction. The magnitude of the second duck is greater than the zeroth and the first duck. So, the second duck will bump with the first duck and absorb it. It will then bump into the zeroth duck and absorb it too!   Here’s the C++ function we want you to finish! vector duckDisappearance(vector& ducks) {   # your code here} You can test your code at these locations: https://www.onlinegdb.com/ or https://cpp.sh/ 

Tags: Accounting, Basic, qmb,

Post navigation

Previous Post Previous post:
BIOL 2404 lab final exam13.jpg
Next Post Next post:
BIOL 2404 lab final exam14.jpg

GradePack

  • Privacy Policy
  • Terms of Service
Top