UCSD CSE Summer Series

Hi all!

Here with summer series updates!

🔗 Links and Resources

Important enrollment deadlines are coming up! Check out these links for information on the enrollment process:

https://cse.ucsd.edu/undergraduate/courses/enrolling-cse-courses

https://cse.ucsd.edu/undergraduate/fall-2025-undergraduate-course-updates

In particular: “CSE/EC26 Major Major Priority Deadline: Tuesday, August 26th 11:59PM - Current incoming CSE/EC26 majors who want enrollment priority must waitlist their requested applicable courses by the stated date/time.”

So please reach out, make sure you’ve had a look at classes, reach out to advising if needed, and understand that if you’re a CSE major getting on waitlists before Tuesday is important!

I continue to hold Remote Office Hours on Tuesdays at 11am pacific time for the rest of the summer. You can find the link through my contact page which has a calendar of many advising office hours!

The website https://cse-summer-series.github.io/2025/ has all of these messages

Do Now! (Do one, some, or all!)

The code from today’s video is also copied here for your reference:

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    public boolean isUnivalTree(TreeNode node) {
        // First check if this node has the same value as left/right children
        // Then, check that left/right children are unival trees
        if(node == null) { return true; }
        boolean leftValOK = (node.left == null) || (node.left.val == node.val);
        boolean rightValOK = (node.right == null) || (node.right.val == node.val);
        if(!leftValOK || !rightValOK) { return false; }

        boolean leftTreeOK = isUnivalTree(node.left);
        boolean rightTreeOK = isUnivalTree(node.right);

        return leftTreeOK && rightTreeOK;
    }

}
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
bool isUnivalTree(struct TreeNode* node) {
    if(node == NULL) { return 1; }
    int leftValOK = (node->left == NULL) || (node->left->val == node->val);
    int rightValOK = (node->right == NULL) || (node->right->val == node->val);
    if(!leftValOK || !rightValOK) { return 0; }

    int leftTreeOK = isUnivalTree(node->left);
    int rightTreeOK = isUnivalTree(node->right);
    return leftTreeOK && rightTreeOK;
}