CS 106A – Ed Discussion
Please read this problem and try it yourself before class tomorrow. In addition to the midterm retro, we will discuss this problem as well. This is probably as hard as I'll make the final exam problem on classes (ie, the actual exam problem should be easier) Adapted from a problem by Julie Zelinski The RandomBag class models a collection of names with an operation for random selection, such as might be used for a lottery. The bag capacity is set in the constructor. The add operation adds a name to the bag. The choose operation selects a name from the bag at random and removes it. Here is the interface of the class: You are to write the complete RandomBag class, including implementation of the constructor and member functions. Design: A RandomBag holds a collection of names. The required internal representation is a list of strings (this means, you constructor should initialize a list to hold the names). The names in the list are in no particular order. Your design can include other ins
Ed Discussion Skip to main content
related reading
- 275A, Notes 0: Foundations of probability theory | What's newterrytao.wordpress.com
- Gra koło fortunypl.piliapp.com
- random_graphs.pdfinst.eecs.berkeley.edu
- Introduction to Probability by Joseph K. Blitzstein, Jessica Hwang (z-lib.org).pdfuni.dcdev.ro
- Reference class problemen.wikipedia.org
- CSE290A - Randomized Algorithmsusers.soe.ucsc.edu
- CS106B Classes and Dynamic Memoryweb.stanford.edu
- Random self-reducibilityen.wikipedia.org
- The Power of Noise — LessWronglesswrong.com
- Random forest - Wikipediaen.wikipedia.org
- Mini Rando Sewing Pattern (PDF) — THE FUNCTIONAL SEWING PROJECTthefunctionalsewingproject.com
- RSI Simulator | Paradigmparadigm.xyz