Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. int max = 476625; // maximum number of ADD_NODE commands in 5MB file
  2.  
  3. int treeSize = sizeof(Tree);
  4. int listSize = sizeof(List);
  5. int nodeSize = sizeof(Node);
  6. int nodePointerSize = sizeof(Node*);
  7.  
  8. printf("Size of structural types\n\n");
  9. printf("struct Tree: %d\n", treeSize);
  10. printf("struct List: %d\n", listSize);
  11. printf("struct Node: %d\n", nodeSize);
  12.  
  13. printf("\nSize of all instances of types above\n\n");
  14. printf("%d Nodes: %d\n", max, max * nodeSize);
  15. printf("%d Lists: %d\n", max, max * listSize);
  16. printf("%d Sentinels (Nodes): %d\n", 2 * max, 2 * max * nodeSize);
  17. printf("Array of %d Node pointers: %d\n", max, max * nodePointerSize);
  18.  
  19. int all = max * (3 * nodeSize + listSize + nodePointerSize);
  20.  
  21. printf("\nAll: %d\n", all);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement