Computer Science

Indirect File Names

Indirect File Names

When working with Linux (BSD or Unix, or even MacOS) command line programs, you often work with file names.

Depth-first Unary Degree Sequence

Depth-first Unary Degree Sequence

The old Daily Coding Problem email list gave us this problem around 2020:

Daily Coding Problem: Problem #237 [Easy]

A tree is symmetric if its data and shape remain unchanged when it is reflected about the root node. The following tree is an example:

        4
      / | \
    3   5   3
  /           \
 9             9

Given a k-ary tree, determine whether it is symmetric.

This problem is less well described than I thought when I worked on it in 2020.

Dyck Languages

Dyck Languages

There’s an older programming job interview question:

Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed).

For example, given the string “([])”, you should return true.

Given the string “([)]” or “((()”, you should return false.

Mergesort Investigation 16 - sorting reverse sorted lists

Mergesort Investigation 16 - sorting reverse sorted lists

There’s one more item I discovered during my mergesort investigation that bothers me. I wrote code that finishes with a low-to-high data value list. Starting with a “reverse sorted” (high-to-low data values) list with Wikipedia’s bottom up algorithm does not show the abrupt performance drops that a randomly-chosen data values initial list does, but has bumps in comparison count at lists of 2N+1 lengths.

Why is this?

Mergesort Investigation Summary

Mergesort Investigation Summary