Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "tree.h"
- int main() {
- int max = 476625; // maximum number of ADD_NODE commands in 5MB file
- int treeSize = sizeof(Tree);
- int listSize = sizeof(List);
- int nodeSize = sizeof(Node);
- int nodePointerSize = sizeof(Node*);
- printf("Size of structural types\n\n");
- printf("struct Tree: %d\n", treeSize);
- printf("struct List: %d\n", listSize);
- printf("struct Node: %d\n", nodeSize);
- printf("\nSize of all instances of types above\n\n");
- printf("%d Nodes: %d\n", max, max * nodeSize);
- printf("%d Lists: %d\n", max, max * listSize);
- printf("%d Sentinels (Nodes): %d\n", 2 * max, 2 * max * nodeSize);
- printf("Array of %d Node pointers: %d\n", max, max * nodePointerSize);
- int all = max * (3 * nodeSize + listSize + nodePointerSize);
- printf("\nAll: %d\n", all);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement