# How to add a tag to each row and column of a matrix

I need to assign a tag to each row and column of a matrix. Currently, I have only figured out how to create the matrix:

\begin{align*}
\begin{bmatrix}
\{q_0\} & \{q_0, q_1\} \\
\{q_2\} & \emptyset \\
\emptyset & \emptyset
\end{bmatrix}
\end{align*}


Which yields the following matrix:

I need to add q_0, q_1 and q_2 tags to the rows and 0 and 1 tags to the columns as shown in the image below.

Is there any way to do this?

Since the solution with package blkarray isn't mentioned in the above link, I'll add it here:
\documentclass{article}
$\begin{blockarray}{rcc} & 0 & 1 \\ \begin{block}{r[cc]} q_0 & \{q_0\} & \{q_0,q_1\}\bigstrut[t] \\ q_1 & \{q_2\} & \varnothing \\ q_2 & \varnothing & \varnothing \\ \end{block} \end{blockarray}$%