teaching machines

CS 240: Lecture 27 – AVL Trees

Dear students: Last time we introduced a special case of binary trees in which the left descendents are all less than their root and all the right descendents are greater. Such a tree holds the binary search in its bones. The binary search is fast, right? We like that. To get that speed, we need […]

CS 347: Lab 16 – Follownet

Dear students: Welcome to lab. Now’s your chance to apply the ideas you read about. Find a partner and complete as much of the task below as you can. At the end of our time together, paste your files into Crowdsource in order to receive credit. Task 1 Create a database with two tables. The […]

CS 240: Lecture 26 – Binary Search Trees

Dear students: Fall break is over. Just four more weeks to the next one. And then two more weeks of the semester after that. Then finals. Then whew. In the weeks that we have left we’ll be talking about trees, dictionaries, hashing, and graphs. The good news is that these are all useful tools. The […]

CS 240: Lecture 25 – Expression Tree Lab

Dear students: Today we will devote our entire time together to a lab on expression trees. Follow these guidelines: You may work with one other person. If there’s an odd number of people, one group of three is permitted. Complete the lab using a single computer. Take turns at the keyboard. Talk to each other. […]

CS 240: Lecture 24 – Binary Trees

Dear students: We put the sorts behind us. Of course, nothing ever goes away in software development. We just put layers on top of it. Most of the time, we concern ourselves only with the outermost layer of abstraction: what are the methods named and what parameters do they expect? This class is meant to […]

CS 240: Lecture 22 – Sort Review

Dear students: In today’s lab, we’ll work through a few exercises to investigate radix sort and review the five sorting algorithms we’ve discussed: Radix sort exercise Sort review There’s nothing to turn in. Ask lots of questions! TODO You have some work to do before the next class: Complete the second take of mastery quiz […]

CS 240: Lecture 21 – Quicksort and Radix Sort

Dear students: Today we’ll start by walking through the exercises that you started working on last time. We’ll calculate the best and worst case running times of quicksort and reason about why it’s still considered a good sort even though its worst case is no different than insertion sort or selection sort. During the remainder […]

CS 347: Project 2 – Web Service – due October 28

In this second project, you will create a web service that will be consumed by a React client, which you will develop as part of the third project. Your project must meet the following expectations: Your service will not manage a to-do list. This is overdone. Come up with something interesting and original. You will […]

CS 240: Lecture 21 – Quicksort

Dear students: Mergesort has some nice worst case running time, but have you check out quicksort? It too takes a recursive, divide-and-conquer approach to sorting. Here’s the overall algorithm: public static void quicksort(int[] items) { quicksort(items, 0, items.length – 1); } private static void quicksort(int[] items, int left, int right) { int pivotIndex = (left […]

CS 240: Lecture 20 – Recursion Lab

Dear students: Today we will devote our entire time together to solving some programming challenges on Leetcode using recursion. Complete these exercises in Java: 203. Remove Linked List Elements 206. Reverse Linked List 21. Merge Two Sorted Lists 24. Swap Nodes in Pairs 2. Add Two Numbers Find these problems by clicking on the Problems […]

1 2 3 228