// create a recursive data structure typedef struct person { char * first; char * last; Date birthday; struct person friend; } Person;What happens above?
The office hours are Sun/Tue/Thu 8-11 PM at Hillhouse 17 Rm 111.
gjm gjn gjo gkm gkn gko glm gln glo *** hjm ...
% Callme 7245677 -debug Loading dictionary: /usr/share/dict/words Growing to size: 2048. n: 1024. Used buckets: 812. Occupancy rate: 0.79 Growing to size: 4096. n: 2048. Used buckets: 1611. Occupancy rate: 0.79 Growing to size: 8192. n: 4096. Used buckets: 3219. Occupancy rate: 0.79 Growing to size: 16384. n: 8192. Used buckets: 6438. Occupancy rate: 0.79 Growing to size: 32768. n: 16384. Used buckets: 12921. Occupancy rate: 0.79 Growing to size: 65536. n: 32768. Used buckets: 25899. Occupancy rate: 0.79 Here n is the size of the array. However, in the next section The hash table keeps track of how many elements it contains, say n. Once n * MAX_LOAD_FACTOR == SIZE n is the track of how many elements it contains.n is used to count the number of items in the table. Once n reaches the size of the table, the table expands. At that point n == size, but normally n is less than size.
Structs are just fine for creating single data type instances, like strings. It is usually more interesting to create data structures that actually produce structures. The simplest structure is a linked list. We will later see more complex structures, like trees and graphs, which are variations on linked lists.