m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/definitions.sty
blob: 0726ee5524a7681954750b082e4e66b6b58ed23a (plain)
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
\usepackage{ifthen}

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{problem}[theorem]{Problem}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{observation}[theorem]{Observation}

% #1 (optional): Fixed parameters of the problem
% #2: Name of query problem
% #3: The structure to preprocess
% #4: Queries to handle
\newcommand{\queryproblem}[4][]{
    \begin{problem}
        \upshape
        \textsc{#2} \\
        \ifthenelse{\equal{#1}{}}{}{\textbf{Fixed:} #1 \\}
        \textbf{Given:} #3 \\
        \textbf{Queries:} #4
    \end{problem}
}

\newcommand{\qptime}[2]{$\langle$#1, #2$\rangle$}
\newcommand{\qpoptimal}{\qptime{$O(n)$}{$O(1)$}}

\newcommand{\definedterm}[1]{\emph{#1}}

\newcommand{\data}[1]{\textsf{#1}}
\newcommand{\infixtable}{\data{in}}
\newcommand{\posttable}{\data{post}}
\newcommand{\prefixtable}{\data{pre}}
\newcommand{\indextable}{\data{index}}
\newcommand{\componenttable}{\data{component}}
\newcommand{\breaktable}{\data{break}}

\newcommand{\mathlca}{\mathit{LCA}}