cs paper 1 Flashcards
regular expresssions
- a tool which allows computers to work with text patterns
- used for:
Validation of input
match patterns in text files
Metacharacters
- (astrix)= 0 or more preceding elements
+ = 1 or more preceding elements
? = 0 or 1 preceding elements
() = used to grp toghther regular expression
- (astrix)= 0 or more preceding elements
= OR operator
Syntax
- all programms must follow strict rules regarding their structure
BNF
- formal mathematical way of defining syntax unambiguosly
- consists of:
set of terminal symbols
set of non-terminal symbols
set of production rules
<LETTER> ::=A|B|C....|Z
</LETTER>
= OR
parsing
- working out if a given statement is valid according to the given BNF production rules
syntax diagram
- graphical representation of BNF
time/space complexity
-no. of steps/memory used by an algorithm
Big O notation
complexity of algorithms -tips
hardware limits
-problem requires more computer memory than is feasible
-problem has an exponential complexity = using more processors makes little difference
tractable problems
Any problem, which is solvable in polynomial time or better
intractable problem
Any problem which cannot be solved in Polynomial time or better
computable problem
If an algorithm can be constructed to solve a particular problem then that problem is computable
problems computer can’t do/easily
-borad, poorly defined problems
-problems that call for subjective evaluations
halting problem
-Shows that there exists some problem which simply cannot be solved by computers