-------------------------------- Start Of Program -------------------------------- ************************************************ Unit Test # 0: HASH_TABLE constructor, print method, and destructor. ************************************************ HASH_TABLE hash_table; hash_table.print(output); -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b880. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b880. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b888. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da804b8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 10. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804b8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804b8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80600. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80600. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[6] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[7] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[8] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[9] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80500. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80500. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- ************************************************ Unit Test # 1: HASH_TABLE constructor, insert method, print method, and destructor. ************************************************ HASH_TABLE hash_table; NODE node; node.key = "unit_test_1"; node.next = NULL; hash_table.insert_node(&node); hash_table.print(output); -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b860. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b860. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b868. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da804b8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 10. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804b8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804b8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80600. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b870. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80600. p -> key = HEAD. p -> next = 0x7ffc9c06b870. }. NODE_1 := { p := 0x7ffc9c06b870. p -> key = unit_test_1. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[6] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[7] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[8] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[9] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80500. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80500. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- ************************************************ Unit Test # 2: HASH_TABLE constructor, insert method, print method, and destructor. ************************************************ HASH_TABLE hash_table; NODE node_A = { key : "node_A", next : NULL }; NODE node_B = { key : "node_B", next : NULL }; NODE node_C = { key : "node_C", next : NULL }; hash_table.insert_node(&node_A); hash_table.insert_node(&node_B); hash_table.insert_node(&node_C); output << hash_table; // functionally identical to hash_table.print(output) -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b800. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b800. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b808. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da804b8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 10. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804b8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804b8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b810. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0x7ffc9c06b810. }. NODE_1 := { p := 0x7ffc9c06b810. p -> key = node_A. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b840. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0x7ffc9c06b840. }. NODE_1 := { p := 0x7ffc9c06b840. p -> key = node_B. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b870. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0x7ffc9c06b870. }. NODE_1 := { p := 0x7ffc9c06b870. p -> key = node_C. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[6] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[7] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[8] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80600. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80600. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[9] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80500. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80500. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- ************************************************ Unit Test # 3: HASH_TABLE constructor, insert method, number of linked lists method, number of node method, print method, and destructor. ************************************************ HASH_TABLE hash_table = HASH_TABLE(5); NODE node_A = { key : "node_A", next : NULL }; NODE node_B = { key : "node_B", next : NULL }; NODE node_C = { key : "node_C", next : NULL }; NODE node_AA = { key : "node_AA", next : NULL }; NODE node_BB = { key : "node_BB", next : NULL }; NODE node_CC = { key : "node_CC", next : NULL }; NODE node_Z = { key : "node_Z", next : NULL }; NODE node_666 = { key : "node_666", next : NULL }; hash_table.insert_node(&node_A); hash_table.insert_node(&node_B); hash_table.insert_node(&node_C); hash_table.insert_node(&node_AA); hash_table.insert_node(&node_BB); hash_table.insert_node(&node_CC); hash_table.insert_node(&node_Z); hash_table.insert_node(&node_666); output << hash_table; // functionally identical to hash_table.print(output) hash_table.get_number_of_linked_lists_in_hash_table() = 5. hash_table.get_number_of_nodes_in_hash_table()= 13. -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b710. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b710. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b718. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da806f8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 5. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da806f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da806f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80700. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80700. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b810. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0x7ffc9c06b810. }. NODE_1 := { p := 0x7ffc9c06b810. p -> key = node_CC. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80708. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80708. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b720. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 4. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0x7ffc9c06b720. }. NODE_1 := { p := 0x7ffc9c06b720. p -> key = node_A. p -> next = 0x7ffc9c06b7b0. }. NODE_2 := { p := 0x7ffc9c06b7b0. p -> key = node_AA. p -> next = 0x7ffc9c06b840. }. NODE_3 := { p := 0x7ffc9c06b840. p -> key = node_Z. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80710. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80710. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b750. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 2. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0x7ffc9c06b750. }. NODE_1 := { p := 0x7ffc9c06b750. p -> key = node_B. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80718. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80718. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b780. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 4. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0x7ffc9c06b780. }. NODE_1 := { p := 0x7ffc9c06b780. p -> key = node_C. p -> next = 0x7ffc9c06b7e0. }. NODE_2 := { p := 0x7ffc9c06b7e0. p -> key = node_BB. p -> next = 0x7ffc9c06b870. }. NODE_3 := { p := 0x7ffc9c06b870. p -> key = node_666. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- ************************************************ Unit Test # 4: HASH_TABLE constructor, insert method, remove method, print method, and destructor. ************************************************ HASH_TABLE hash_table; NODE node_0 = { key : "XXX", next : NULL }; NODE node_1 = { key : "YYY", next : NULL }; NODE node_2 = { key : "ZZZ", next : NULL }; NODE node_3 = { key : "XXX", next : NULL }; NODE node_4 = { key : "YYY", next : NULL }; NODE node_5 = { key : "ZZZ", next : NULL }; NODE node_6 = { key : "XXX", next : NULL }; NODE node_7 = { key : "YYY", next : NULL }; NODE node_8 = { key : "ZZZ", next : NULL }; NODE node_9 = { key : "XXX", next : NULL }; NODE node_10 = { key : "YYY", next : NULL }; NODE node_11 = { key : "ZZZ", next : NULL }; hash_table.insert_node(&node_0); hash_table.insert_node(&node_1); hash_table.insert_node(&node_2); hash_table.insert_node(&node_3); hash_table.insert_node(&node_4); hash_table.insert_node(&node_5); hash_table.insert_node(&node_6); hash_table.insert_node(&node_7); hash_table.insert_node(&node_8); hash_table.insert_node(&node_9); hash_table.insert_node(&node_10); hash_table.insert_node(&node_11); hash_table.print(output); hash_table.remove_nodes_with_key("XXX"); hash_table.print(output); -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b630. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b630. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b638. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da804b8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 10. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804b8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804b8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b6c0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0x7ffc9c06b6c0. }. NODE_1 := { p := 0x7ffc9c06b6c0. p -> key = ZZZ. p -> next = 0x7ffc9c06b750. }. NODE_2 := { p := 0x7ffc9c06b750. p -> key = ZZZ. p -> next = 0x7ffc9c06b7e0. }. NODE_3 := { p := 0x7ffc9c06b7e0. p -> key = ZZZ. p -> next = 0x7ffc9c06b870. }. NODE_4 := { p := 0x7ffc9c06b870. p -> key = ZZZ. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80600. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80600. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b660. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0x7ffc9c06b660. }. NODE_1 := { p := 0x7ffc9c06b660. p -> key = XXX. p -> next = 0x7ffc9c06b6f0. }. NODE_2 := { p := 0x7ffc9c06b6f0. p -> key = XXX. p -> next = 0x7ffc9c06b780. }. NODE_3 := { p := 0x7ffc9c06b780. p -> key = XXX. p -> next = 0x7ffc9c06b810. }. NODE_4 := { p := 0x7ffc9c06b810. p -> key = XXX. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[6] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[7] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b690. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0x7ffc9c06b690. }. NODE_1 := { p := 0x7ffc9c06b690. p -> key = YYY. p -> next = 0x7ffc9c06b720. }. NODE_2 := { p := 0x7ffc9c06b720. p -> key = YYY. p -> next = 0x7ffc9c06b7b0. }. NODE_3 := { p := 0x7ffc9c06b7b0. p -> key = YYY. p -> next = 0x7ffc9c06b840. }. NODE_4 := { p := 0x7ffc9c06b840. p -> key = YYY. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[8] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[9] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80500. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80500. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b630. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b630. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b638. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da804b8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 10. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804b8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804b8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80510. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b6c0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80510. p -> key = HEAD. p -> next = 0x7ffc9c06b6c0. }. NODE_1 := { p := 0x7ffc9c06b6c0. p -> key = ZZZ. p -> next = 0x7ffc9c06b750. }. NODE_2 := { p := 0x7ffc9c06b750. p -> key = ZZZ. p -> next = 0x7ffc9c06b7e0. }. NODE_3 := { p := 0x7ffc9c06b7e0. p -> key = ZZZ. p -> next = 0x7ffc9c06b870. }. NODE_4 := { p := 0x7ffc9c06b870. p -> key = ZZZ. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80540. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80540. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804c8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804c8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80600. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80600. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804d8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804d8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[6] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804e8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804e8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[7] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f0. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b690. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0x7ffc9c06b690. }. NODE_1 := { p := 0x7ffc9c06b690. p -> key = YYY. p -> next = 0x7ffc9c06b720. }. NODE_2 := { p := 0x7ffc9c06b720. p -> key = YYY. p -> next = 0x7ffc9c06b7b0. }. NODE_3 := { p := 0x7ffc9c06b7b0. p -> key = YYY. p -> next = 0x7ffc9c06b840. }. NODE_4 := { p := 0x7ffc9c06b840. p -> key = YYY. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[8] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da804f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da804f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[9] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80500. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80500. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- ************************************************ Unit Test # 5: HASH_TABLE constructor, insert method, get nodes with key method, print method, and destructor. ************************************************ HASH_TABLE hash_table = HASH_TABLE(6); NODE node_0 = { key : "AAAA", next : NULL }; NODE node_1 = { key : "ABAB", next : NULL }; NODE node_2 = { key : "AABB", next : NULL }; NODE node_3 = { key : "CCCC", next : NULL }; NODE node_4 = { key : "ABAB", next : NULL }; NODE node_5 = { key : "CCCC", next : NULL }; NODE node_6 = { key : "BBBB", next : NULL }; NODE node_7 = { key : "ABAB", next : NULL }; NODE node_8 = { key : "AAAA", next : NULL }; NODE node_9 = { key : "CCCC", next : NULL }; NODE node_10 = { key : "DDDD", next : NULL }; NODE node_11 = { key : "AABB", next : NULL }; NODE node_12 = { key : "EEEE", next : NULL }; NODE node_13 = { key : "DDDD", next : NULL }; NODE node_14 = { key : "ABAB", next : NULL }; hash_table.insert_node(&node_0); hash_table.insert_node(&node_1); hash_table.insert_node(&node_2); hash_table.insert_node(&node_3); hash_table.insert_node(&node_4); hash_table.insert_node(&node_5); hash_table.insert_node(&node_6); hash_table.insert_node(&node_7); hash_table.insert_node(&node_8); hash_table.insert_node(&node_9); hash_table.insert_node(&node_10); hash_table.insert_node(&node_11); hash_table.insert_node(&node_12); hash_table.insert_node(&node_13); hash_table.insert_node(&node_14); output << hash_table; // functionally identical to hash_table.print(output) LINKED_LIST search_results = hash_table.get_nodes_with_key("AAAA"); output << search_results; // functionally identical to search_results.print(output); -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b5a0. // The keyword named this is a pointer which stores the memory address of the first memory cell of a HASH_TABLE sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE object. &array = 0x7ffc9c06b5a0. // The reference operation returns the memory address of the first memory cell of a pointer-to-LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named array. &N = 0x7ffc9c06b5a8. // The reference operation returns the memory address of the first memory cell of a pointer-to-int sized chunk of contiguous memory cells which are allocated to the caller HASH_TABLE data attribute named N. sizeof(int) = 4. // The sizeof() operation returns the number of bytes of memory which a int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(int *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-int type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE) = 16. // The sizeof() operation returns the number of bytes of memory which a HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(HASH_TABLE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-HASH_TABLE type variable occupies. (Each memory cell has a data capacity of 1 byte). array = 0x564e5da806f8. // array stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a LINKED_LIST type variable or else array stores NULL (and the value NULL is displayed as 0). N = 6. // N stores the total number of LINKED_LIST types elements which are represented by the array property of the caller HASH_TABLE object. HASH_TABLE := { ############################################################ array[0] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da806f8. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da806f8. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805a0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b6f0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 3. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805a0. p -> key = HEAD. p -> next = 0x7ffc9c06b6f0. }. NODE_1 := { p := 0x7ffc9c06b6f0. p -> key = BBBB. p -> next = 0x7ffc9c06b810. }. NODE_2 := { p := 0x7ffc9c06b810. p -> key = EEEE. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[1] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80700. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80700. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da805d0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da805d0. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[2] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80708. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80708. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80690. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b5d0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 5. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80690. p -> key = HEAD. p -> next = 0x7ffc9c06b5d0. }. NODE_1 := { p := 0x7ffc9c06b5d0. p -> key = AAAA. p -> next = 0x7ffc9c06b750. }. NODE_2 := { p := 0x7ffc9c06b750. p -> key = AAAA. p -> next = 0x7ffc9c06b7b0. }. NODE_3 := { p := 0x7ffc9c06b7b0. p -> key = DDDD. p -> next = 0x7ffc9c06b840. }. NODE_4 := { p := 0x7ffc9c06b840. p -> key = DDDD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[3] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80710. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80710. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80630. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80630. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[4] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80718. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80718. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80660. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b600. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 10. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80660. p -> key = HEAD. p -> next = 0x7ffc9c06b600. }. NODE_1 := { p := 0x7ffc9c06b600. p -> key = ABAB. p -> next = 0x7ffc9c06b630. }. NODE_2 := { p := 0x7ffc9c06b630. p -> key = AABB. p -> next = 0x7ffc9c06b660. }. NODE_3 := { p := 0x7ffc9c06b660. p -> key = CCCC. p -> next = 0x7ffc9c06b690. }. NODE_4 := { p := 0x7ffc9c06b690. p -> key = ABAB. p -> next = 0x7ffc9c06b6c0. }. NODE_5 := { p := 0x7ffc9c06b6c0. p -> key = CCCC. p -> next = 0x7ffc9c06b720. }. NODE_6 := { p := 0x7ffc9c06b720. p -> key = ABAB. p -> next = 0x7ffc9c06b780. }. NODE_7 := { p := 0x7ffc9c06b780. p -> key = CCCC. p -> next = 0x7ffc9c06b7e0. }. NODE_8 := { p := 0x7ffc9c06b7e0. p -> key = AABB. p -> next = 0x7ffc9c06b870. }. NODE_9 := { p := 0x7ffc9c06b870. p -> key = ABAB. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ ############################################################ array[5] := { -------------------------------------------------------------------------------------------------- this = 0x564e5da80720. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x564e5da80720. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da80570. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 1. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da80570. p -> key = HEAD. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- }. ############################################################ }. -------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------- this = 0x7ffc9c06b598. // The keyword named this is a pointer which stores the memory address of the first memory cell of a LINKED_LIST sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST object. &head = 0x7ffc9c06b598. // The reference operation returns the memory address of the first memory cell of a pointer-to-NODE sized chunk of contiguous memory cells which are allocated to the caller LINKED_LIST data attribute named head. sizeof(NODE) = 40. // The sizeof() operation returns the number of bytes of memory which a NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(std::string) = 32. // The sizeof() operation returns the number of bytes of memory which a string type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(NODE *) = 8. // The sizeof() operation returns the number of bytes of memory which a pointer-to-NODE type variable occupies. (Each memory cell has a data capacity of 1 byte). sizeof(LINKED_LIST) = 8. // The sizeof() operation returns the number of bytes of memory which a LINKED_LIST type variable occupies. (Each memory cell has a data capacity of 1 byte). head = 0x564e5da806c0. // head stores either the first memory cell of a contiguous chunk of memory cells which are allocated to a NODE type variable or else head stores NULL (and the value NULL is displayed as 0). head -> key = HEAD. // The arrow operator returns the string type property named key of the NODE type variable which head points to. head -> next = 0x7ffc9c06b5d0. // The arrow operator returns the pointer-to-NODE type property named next of the NODE type variable which head points to. get_number_of_nodes_in_list() = 3. // p is a pointer to a NODE type variable. LINKED_LIST := { NODE_0 := { p := 0x564e5da806c0. p -> key = HEAD. p -> next = 0x7ffc9c06b5d0. }. NODE_1 := { p := 0x7ffc9c06b5d0. p -> key = AAAA. p -> next = 0x7ffc9c06b750. }. NODE_2 := { p := 0x7ffc9c06b750. p -> key = AAAA. p -> next = 0. }. }. -------------------------------------------------------------------------------------------------- -------------------------------- End Of Program --------------------------------