Algorithms & Data Structures
Algorithms #
Algorithm:
Median if n is odd => i = (n+1)/2 if n is even => two medians (lower and upper median)
Linear data structures #
BNF Grammar #
Backus-Naur-Form (BNF): a metalanguage or notation technique used to describe the syntax of programming languages
Syntax:
- Form of
<nonterminal> ::= ...
- Termninals (the symbols produced) have single quotation marks
'
- Alternatives (disjunction):
|
- Optional part:
[ ]
- Repeated zero or more times:
{ }
When defining a grammar we try to avoid ambiguity such that an expression can only mean one thing.