Discussion 1B: F 4:00-6:00pm in BH 5264 CS 32 – Spring 2008 – UCLA
Office Hours: M 12:30-1:30pm, W 11:30-12:30pm in BH 4428 chuong [at] cs [dot] ucla [dot] edu

News | Projects & HW | Discussions | Related Materials

DISCUSSIONS

Discussion 3 – 04/18/08

  • Singly linked list (with or without a dummy node)
  • Doubly linked list (with or without a dummy node)
  • Walk-through (traverse) a linked list
  • Insertion
    • traverse the list to where we want to insert
    • create new node with new data
    • change the pointers (remember to count how many pointers need to be changed)
  • Deletion
    • traverse the list to the node we want to delete
    • change the pointers (count how many pointers again)
    • delete the node
  • A picture of the linked list always help

Discussion 2 – 04/11/08

  • We talked about the big three: “the copy constructor”, “the = assignment operator”, and “the destructor”. Experts say that if you need any of them, you need all three.

Discussion 1 – 04/04/08

  • In order to prevent infinite loop of include files, e.g.
    • A.h has #include “B.h”
    • B.h has #include “A.h”
  • We will use class ClassName; instead of #include “ClassName.h”, e.g.
    • A.h now replaces the line #include “B.h” with class B;
    • B.h now replaces the line #include “A.h” with class A;