lect11 - CMSC 216 Introduction to Computer Systems Lecture...

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

View Full Document Right Arrow Icon
CMSC 216 Introduction to Computer Systems Lecture 11 Dynamic Mem, Assembly Jan Plane & Pete Keleher {jplane, als}@cs.umd.edu Doubly linked lists • We can have references in both directions • Allows use of only one pointer when performing some operations typedef struct dl_node { struct dl_node *prev; struct dl_node *next; int val; } DL_node; 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
Deletion from a doubly linked list int delete(DL_node **root, int target) { DL_node *current; for (current = *root; current != NULL; current = current->next) if (current->val == target) break; if (current == NULL) return 0; if (current == *root) *root = current->next; else current->prev->next = current->next; if (current->next != NULL) current->next->prev = current->prev; free(current); return 1; } 3 A SSEMBLY L ANGUAGE Chapters 3 and 4.1, Bryant and O'Hallaron 4
Background image of page 2
Assembly language • The CPU uses machine language to perform all its operations • Assembly is a much more readable translation of machine language, and it is what we work with if we need to see what the
Background image of page 3

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

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

Page1 / 4

lect11 - CMSC 216 Introduction to Computer Systems Lecture...

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

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