Labs

General information

For the most part, COSC201 labs are going to be done in a workshop style. We will provide some skeleton code and some questions. It’s up to you to add to the code so that you can answer the questions. Not all labs have credit associated with them. For those that do, it’s a simple complete/incomplete distinction. Completing eight assessed labs over the course of the semester will get you full credit for the lab component of the internal assessment. Completing more than eight labs will get you a sense of satisfaction and a deeper knowledge of data structures and algorithms but, I am afraid, still only full credit for the lab component of the internal assessment.

In general, labs will be assessed by demonstrators in the labs, or possibly via Zoom, Teams or discord if you’re unable to attend the labs, and all you will need to demonstrate is that you’ve engaged with the lab’s materials. Labs are due by the end of the week following their nominal delivery. Extensions may be granted if you need them (and ask!)

Remember that for most labs there will be some skeleton code available at cosc201code2025 - and other code there could be helpful too!

Lab details

  • Lab 0 (not assessed) You need to get familiar with the lab setup. If you’re taking COSC202 as well, then your COSC202 labs for week 1 are designed to do that. If not, then please attend your regular COSC201 lab B session on Wednesday or Friday and helpful staff will be there for you! There are no A sessions this week (Mon/Tue). The COSC202 Tiddlywiki will give you instructions on the basic use of Java, the NetBeans IDE, and the Gradle build tool.
  • Lab 1 (assessed, Week 2 ending March 7) Timing things In this lab you’ll answer some basic questions about wall-clock timing of programs (and think about the relationship with the more theoretical analysis of algorithmic timing). For those not doing COSC 202: you should also carry out the Git Started and Unix Shell activities from the COSC 202 course handbook.
  • Lab 2 (assessed, Week 3 ending March 14) Recursion and union-find In this lab you’ll look at some timing in recursive functions (and variations) and then, as a preparation towards Assignment 1, work a bit with the union-find data structures and look at writing a program to read scripts and carry out operations on them. There’s a video in the Demonstrations section in Echo360 called “Writing a script reader” that might be useful (this was recorded in a previous year so the references to lectures might be slightly out of step).
  • Lab 3 (assessed, Week 4 ending March 21) Tableaux This lab is somewhat orthogonal to the rest of the paper but provides good practice with working with arrays and addresses some issues about checking that conditions are satisfied in a data structure.
  • Week 5 (ends March 28) No assessed lab this week as I expect you’ll be finishing up Assignment 1. The demonstrators can provide some help (with limits of course).
  • Lab 4 (assessed, Week 6 ending April 4) Shuffling along In looking at merge sort a fundamental operation that was used was merging two halves of an array into a single one based on the order of the relevant elements. What if we do that merge randomly instead? Then we’re shuffling. In this lab you’ll implement a simple version of that shuffle and investigate how well it works.
  • Lab 5 (assessed, Week 7 ending April 11) Graphing the dictionary A lab to practice the use of classes for manipulating graphs, which you’ll need to do in Assignment 2.
  • Lab 6 (assessed, Weeks 8 and 9, ending May 2) Playing in the trees In a change from my usual practices, I am going to ask you to implement a standard data type for which a library class exists, namely the binary search tree. There is a lot of material in this lab which is why it is spread over two weeks and counts double. Note that there will be no lab on Good Friday, April 18 (come to the Wed 1pm-5pm streams instead if you need help).
  • Lab 7 (assessed, Week 10 ending May 9) Stringing you along A fairly short and straightforward lab that allows you some practice with HashSet.
  • Week 11 (ends May 16) No assessed lab this week as I expect you’ll be finishing up Assignment 2. The demonstrators can provide some help (with limits of course).
  • Lab 8 (assessed, Week 12 ending May 23) Candies and hash More practice with HashMap building on some things seen in the lectures.
  • Lab X (end of semester) Propose a lab! Click this link for details