Lesson 05 In-Class Exercises

Part 1: Pseudocode: LinkedList.InsertAtLocation

For this exercise you need to write up pseudocode for the InsertAtLocation method on the MyLinkedList class.  This class is defined in the starter project for the POST Class Exercises, and is listed below for convenience.  If you need more detail on any given method you should find the document/exercise in the PCEs which describes what the method in question should do.

Be ready to present your pseudocode to the class.

public class MyLinkedList
{
    public class LinkedListNode
    {
        public int m_data;
        public LinkedListNode m_next;
    }

    // first item in the list, automtically given the value null
    protected LinkedListNode m_first;

    /* SNIP!  Lots of stuff from the PCE starter project has been left out, for clarity here */

    // Add, BY INDEX
    public void InsertAt(int newData, uint index)
    {
        // // YOUR CODE GOES HERE!!!
    }

    // Remove, BY INDEX
    public void RemoveAt(uint index)
    {
        // // YOUR CODE GOES HERE!!!
    }

    public MyLinkedList Clone()
    {
        // Think about what your code does in each of
        // the three important steps of the 'list traversal' schema, 
        // in order to implement this method.
        // You are not required to write this down, but it's recommended that you
        // do so.

        // YOUR CODE GOES HERE!!!
        return null;
    }
}

Part 2: Pseudocode: LinkedList.RemoveAtLocation

This exercise is basically the same as the prior exercise, except that this is for the RemoveAtLocation method.

The instructor is breaking up the overall goal of "write pseudocode for all the methods" into separate parts so that it will be easier to clearly identify which method everyone should be working on.

Part 3: Pseudocode & "Tracing": LinkedList.Clone

This exercise is basically the same as the prior exercise, except that this is for the Clone method.

The instructor is breaking up the overall goal of "write pseudocode for all the methods" into separate parts so that it will be easier to clearly identify which method everyone should be working on.

Part 4: Pseudocode & "Tracing": LinkedList.AddByValue

This exercise is basically the same as the prior exercise, except that this is for the AddByValue method.

The instructor is breaking up the overall goal of "write pseudocode for all the methods" into separate parts so that it will be easier to clearly identify which method everyone should be working on.

Part 5: Pseudocode & "Tracing": LinkedList.RemoveByValue

This exercise is basically the same as the prior exercise, except that this is for the RemoveByValue method.

The instructor is breaking up the overall goal of "write pseudocode for all the methods" into separate parts so that it will be easier to clearly identify which method everyone should be working on.

Future Ideas

 

One Minute Paper

"A “one-minute paper” may be defined as a very short, in-class writing activity (taking one-minute or less to complete) in response to an instructor-posed question, which prompts students to reflect on the day’s lesson and provides the instructor with useful feedback." (from http://www.oncourseworkshop.com/Awareness012.htm).

For this One Minute Paper, I would like you to think back on both the preview videos / viewing quiz and today's in-class exercises, and quickly write up answers to two questions:

  1. What was the thing that you were most confused about at the start of this lecture? (Also let me know if you're still confused about this)
  2. Which of the in-class exercises and activities were most helpful to you, and why?

Head on over to the Google Docs form, and fill out the One Minute Paper for this lecture.