Coding Problems

Fitting a list of words to a a regular expression

Fitting a list of words to a a regular expression

John D. Cook Consulting seems to do the manner of work that regular programmers like me only dream of doing, and their blog entries are uniformly interesting, educational and somehow esoteric. I’m amazed by them.

John D. Cook Consulting’s blog published a post Fitting a regular expression to a list of words where (apparently!) John Cook himself shows how to use a Python library to combine several strings into a regular expression that, when interpreted by a program like grep, will match all those strings.

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.

Linked List Problems

Linked List Problems

I found a set of linked list coding problems I’d never seen before.

The document is titled Linked List Problems, written and copyright by Nick Parlante, dated 2002. Apparently Linked List Problems is part of the Stanford CS Education Library, which looks to date to around the end of the 20th Century.

Mergesort Investigation Summary

Mergesort Investigation Summary