rec8-2010 - sequence of nodes • Each node has a reference...

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

View Full Document Right Arrow Icon
University of Minnesota University of Minnesota CSCI 4061 Recitation 8
Background image of page 1

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

View Full Document Right Arrow Icon
University of Minnesota University of Minnesota Today SIGALRM Linked Lists
Background image of page 2
University of Minnesota University of Minnesota SIGALRM SIGALRM is a signal sent to a process once a time limit has elapsed. Defined in the signal.h header.
Background image of page 3

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

View Full Document Right Arrow Icon
University of Minnesota University of Minnesota SIGALRM Can be used to make a long- running action time out or to perform an action periodically.
Background image of page 4
University of Minnesota University of Minnesota SIGALRM Can be scheduled from alarm(int seconds) function.
Background image of page 5

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

View Full Document Right Arrow Icon
University of Minnesota University of Minnesota SIGALRM SIGALRM and alarm are used to implement Sleep().
Background image of page 6
University of Minnesota University of Minnesota SIGALRM Exercise Write a signal handler that handles SIGALRM and prints “Woke up for the # time” Call alarm(5) three times.
Background image of page 7

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

View Full Document Right Arrow Icon
University of Minnesota University of Minnesota Linked Lists A Linked List is a data structure that consists of a
Background image of page 8
Background image of page 9

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

View Full Document Right Arrow Icon
Background image of page 10
Background image of page 11

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

View Full Document Right Arrow Icon
Background image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sequence of nodes. • Each node has a reference to the next node in the list. • Picture from wikipedia University of Minnesota University of Minnesota Linked Lists • Key element is a struct that holds data and a reference to the next node. • struct node { char data[70]; node * next; }; University of Minnesota University of Minnesota Linked Lists • Keep a pointer to the first node in the list. • The last node in the list points to NULL. University of Minnesota University of Minnesota Linked Lists • How do you iterate through the list? • How do you insert nodes? • How do you delete a node? University of Minnesota University of Minnesota Linked Lists Exercise • Build a linked list to store the characters a,b,c,d,e. • Print out the list. • Delete the last node, reprint. • Delete the first node, reprint. • Delete the 'c' node, reprint....
View Full Document

{[ snackBarMessage ]}

Page1 / 12

rec8-2010 - sequence of nodes • Each node has a reference...

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

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