Step() public method

When one Adds an element to a binomial sketch, a random bit among the subset of k that are currently 0 (false) will be set to 1 (true). To ensure roughly half the bits remain zero at all times, a random index from the subset of all k bits that are currently 1 (true) will be set to 0 (false).
public Step ( string key, int heightOfLadderInRungs = null ) : int
key string The element to add to the set.
heightOfLadderInRungs int Set if using a ladder shorter than the default for this sketch
return int
        public void TwentyObservations()
        {
            BinomialLadderFilter freqFilter = new BinomialLadderFilter(1024*1024*1024, 64);
            string somethingToObserve = "Gosh.  It's a nice day out, isn't it?";

            int observationCount = freqFilter.GetHeight(somethingToObserve);

            for (int i = 0; i < 25; i++)
            {
                int lastCount = freqFilter.Step(somethingToObserve);
                Assert.Equal(observationCount, lastCount);
                observationCount++;
            }

            Assert.Equal(observationCount, freqFilter.GetHeight(somethingToObserve));
        }
        /// <summary>
        /// This method will prime the simulator with known-popular passwords so that they are treated
        /// as if the simulator had already observed them (or been configured with them)
        /// </summary>
        /// <returns></returns>
        public void PrimeWithKnownPasswordsAsync(BinomialLadderFilter freqFilter, int numberOfTimesToPrime)
        {

            for (int i = 0; i < numberOfTimesToPrime; i++)
            {
                Parallel.ForEach(_passwordsAlreadyKnownToBePopular,
                    (password) => freqFilter.Step(password));
            }
        }