Approximately four hours of class time was dedicated to
covering binary search trees including approximately one
hour on BSBTrees. An additional hour of laboratory time
was spent describing implementation details of BSBTrees
and the teaching assistant was available for questions and
assistance for six more hours.
From the perspective of the professor, including BSBTrees
in these sessions of CS2 had both positive features as well
as some drawbacks.
The fact that the new data structure had significant similarities
to simpler structures, already understood by the students,
helped the students to cope with new or more complicated
concepts by building on the foundation of knowledge
they already possess. BSBTrees are effective in this manner,
since they simply augment the already understood binary
search tree data structure. This allows students to concentrate
on project goals other than implementation complexities
that would arise from a more complicated data structure
such as Red Black or 2-3-4 Trees. Instead of implementation
or theory complexities, the students are free to tackle
concepts relating to investigation, analysis and comparison
to expected results. These concepts might fail to be realized
by students working on more complicated data structures
where the majority of their effort was required and
consumed by trying to cope with complex implementation
theory and debugging.
For the vast majority of students, the topic of BSBTrees
was at an appropriate level of difficulty. Nearly all students
were eventually capable of understanding and performing
the basic operations by hand. Although many students had
some difficulty in implementing the data structure for the
programming project, it was completed at roughly the same
rate and level as the earlier projects. One aspect in particular
that did cause difficulty was the recursive method to
move the items from the initial buffer into a perfectly balanced
binary search tree. The teaching assistant and professor
needed to guide many students through designing this
method multiple times. The difficulty seemed to be caused
by the recursive nature of the method rather than any failure
to understand the idea of moving from a buffer to the
binary tree structure.
Once a student completed the programming portion of
the project, he was to perform testing of performance of the
data structure on a variety of data sets and values of M. Most
students did not complete adequate performance testing of
the structure. While this was not uncommon for some earlier
projects, it seemed that the concept that the choice of buffer
size presented a tradeoff was not clearly understood.
A problem which arises in teaching CS2 is that marginal
students in the course often attempt to complete programming
projects by finding code from the web or getting code
from students who have completed the course in previous
semesters. Obviously, this is ineffective when such code
does not exist. Further, even though binary search tree code
would greatly assist in completing the project, camouflaging
the structure did lead to more code actually being written
by students.
Another advantage of teaching BSBTrees was that students
saw that analyzing the time complexity of various operations
is neither a fixed procedure nor something that can
only be done by appealing to a reference.
The main drawback of presenting a non-standard data
structure was that some students, particularly those who
are already not passing, make a variety of complaints. These
complaints included statements that it is unfair to require
this additional material (“my friend in the other section
doesn’t need to learn this”), that it forces attendance at
class and labs (“I couldn’t make it to class/lab that week,
let me do something else”), and that the structure is unreasonably
hard. While these concerns are fairly simple to
address, they can provide classroom distractions and give a
convenient excuse for some to avoid making an attempt.
Overall, the experience of teaching a non-standard data
structure such as an BSBTree was a positive one.