Pointers-Memory

Pointers-Memory - Data Structures Mapping complex...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Spring, 2011 –– Computational Thinking – Dennis Kafura – CS 2984 Data Structures Mapping complex structures to linear memory
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 Computer memory 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 address value
Background image of page 2
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 Mapping a binary tree to memory 00 01 02 03 04 05 07 Null 3 05 Null 4 06 07 08 09 0A 0B 16 5 0E 1 0C 0D 0E 0F 10 11 Null 9 12 12 13 14 15 16 17 11 0A 2 02 5 2 11 9 4 3 1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 What tree is this? 00 01 02 03 04 05 0A 0D 3 NULL 16 7 06 07 08 09 0A 0B NULL 5 13 02 4 10 0C 0D 0E 0F 10 11 NULL 1 16 07 11 NULL 12 13 14 15 16 17 NULL 9 NULL NULL 2 NULL
Background image of page 4
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 Ideas Using an address to refer to a value by the value’s location in memory: Using adjacency to create relationship 005433 00AA12 00AA12 10 001236 <address> 001234 <address> 001235 <data>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 “C” syntax int a, b; int* aPointer; a = 6; aPointer = &a; b = *aPointer; aPointer a 6 b 6
Background image of page 6
Spring, 2011 – Computational Thinking – Dennis Kafura – CS 2984 “C” syntax struct Node { Node* left; int number; Node* right; }; Nodes node1, node2, node3; right < > left <> number < int> node1
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/23/2012 for the course CS 2984 taught by Professor Lewis during the Spring '08 term at Virginia Tech.

Page1 / 25

Pointers-Memory - Data Structures Mapping complex...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online