H33-SectionHandout8

H33-SectionHandout8 - CS106B Winter 07-08 Handout #33 March...

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

View Full Document Right Arrow Icon
CS106B Handout #33 Winter 07-08 March 3, 2008 Section Handout #8 Problem 1: Extending Editor Buffer Write the method MoveToWordBegin for each of the following versions of the buffer object: a) array implementation. b) stack implementation. c) singly-linked list implementation. This function should move the cursor to the beginning of the word the cursor is currently positioned in. If the cursor were between the 'e' and 'd' in "jumped": T h e q u i c k b r o w n f o x j u m p e d o v e r t h e l a z y ^ calling MoveCursorToWordBegin would position the cursor before the 'j'. T h e q u i c k b r o w n f o x j u m p e d o v e r t h e l a z y ^ Be careful to handle gracefully the cases where the cursor is already at the beginning of a word (by moving cursor to beginning of the previous word), or at the beginning of the buffer. What is the running time of this operation (in Big-O notation) for the three implementations? You may use the function isspace which takes a character and returns a boolean which is true if the character is a space, false otherwise. Problems 2-5:
Background image of page 1

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

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

This note was uploaded on 10/12/2011 for the course CS 108 taught by Professor Smith during the Spring '11 term at Central Mich..

Page1 / 4

H33-SectionHandout8 - CS106B Winter 07-08 Handout #33 March...

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

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