79196093

Date: 2024-11-16 21:40:39
Score: 1
Natty:
Report link

Both Trie and Trie2 end up taking 216 bytes because of how memory alignment works. Even though Trie2 has an extra char variable, the compiler adds padding after it to make sure the array of pointers (child[26]) starts at an 8-byte boundary (which is required for pointers on a 64-bit system). This padding makes the total size of both classes the same, even though the structure of the two classes is slightly different.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Urooz Fatima