18 Matching Annotations
  1. Jul 2023
    1. Suppose the string “a” goes to 1, “b” goes to 2, “c” goes to 3, …, and “z” goes to 26. Then the string “aa” should go to 27, “ab” to 28, “ac” to 29, and so forth. Since there are 26 letters in the English alphabet, we call this enumeration scheme base 26

      so this is how .hashCode works when we take the string and apply the mod % to it to obtain the index of our table?

    2. The swim method repeatedly swaps the current node with its parent until heap invariants are restored.

      I've often heard this same concept being referred to as "Trickling up" and "Trickling down", are these the same thing?

    1. Tries, however, may need to consume a lot of memory space in order to store such a large number of R-length arrays

      So a distinction between tries and binary / ternary search trees is that tries use more memory space?

    2. The ternary search tree (TST)

      There's binary trees and ternary trees, are there any differences between a normal tree and a search tree or are they both the same?

    3. if it preserves the original order of equivalent keys

      what does keys mean in this context? Are you referring to the elements in the array being sorted previously and 'building up' through the sorted iterations or am I missing something?

    4. When N = 1 million, log2 1 million is about 20.When N = 10 million, log2 10 million is about 23.When N = 100 million, log2 100 million is about 27.

      so as N increases, the log(base2) increases

    1. A null next field indicates the end of a sequence of linked nodes.

      So for a LinkedDeque, there are dummy or null nodes at the front and end of the Deque?

    2. For example, the following code represents the linked list [1, 2, 3].

      LinkedList = singlyLinkedList (onlyForwards) DoubleLinkedLIsts = LinkedDeques

    3. is a method for empirically measuring how long a program takes to run by recording exactly how long it takes to run on different inputs.

      Sounds really similar to time complexity, is it the same?

    4. E element

      We can add any variable type as long as the class inherits the same type from the inherited class or interface that it's related to

    5. For example, our LinkedList class can represent linked nodes with a Node class consisting of two fields

      What is the difference between an ArrayList and a LinkedList?