-
Notifications
You must be signed in to change notification settings - Fork 1
/
Miscellaneous.tex
48 lines (36 loc) · 1.6 KB
/
Miscellaneous.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% ============================================= %
% %
% Miscellaneous %
% %
% ============================================= %
\chapter{Miscellaneous}
\chapterinfo{}
%------------------------------
\section{Kirchoff's Matrix}
%\sectioninfo{}
Kirchoff's matrix allows one to calculate the number of spanning trees in a
graph as follows:
1. Compute the Laplacian Matrix as follows\\
\indent\indent $A[i][i]$ = degree of vertex $i$\\
\indent\indent $A[i][j]$ = -1 if vertex $i$ and vertex $j$ are connected, 0 otherwise
2. The number of spanning trees is equal to the determinant of any cofactor
matrix. (The original matrix with the first row and column removed is a
valid cofactor)
%------------------------------
\section{Josephus Problem}
%\sectioninfo{}
Of the first $n$ numbers, if you pick and remove the $kth$ number, determine the last
one standing.
\lstinputlisting[language=Java,label=samplecode,caption=Josephus Problem (Java)]{Code/josephus.txt}
%------------------------------
\section{Poker Class}
%\sectioninfo{}
\lstinputlisting[language=Java,label=samplecode,caption=Poker Class (Java)]{Code/PokerClass.txt}
%------------------------------
\section{Decimal to Roman Numeral Converter}
%\sectioninfo{}
\lstinputlisting[language=C++,label=samplecode,caption=Decimal to Roman Numeral Converter (C++)]{Code/Dec2RomanNumeral.txt}
%------------------------------
\section{Expression Parsing}
%\sectioninfo{}
\lstinputlisting[language=C++,label=samplecode,caption=Expression Parsing (C++)]{Code/ExpressionParsing.txt}