cs paper 1 Flashcards

1
Q

regular expresssions

A
  • a tool which allows computers to work with text patterns
  • used for:
    Validation of input
    match patterns in text files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Metacharacters

A
    • (astrix)= 0 or more preceding elements
      + = 1 or more preceding elements
      ? = 0 or 1 preceding elements
      () = used to grp toghther regular expression

= OR operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Syntax

A
  • all programms must follow strict rules regarding their structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

BNF

A
  • 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

parsing

A
  • working out if a given statement is valid according to the given BNF production rules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

syntax diagram

A
  • graphical representation of BNF
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

time/space complexity

A

-no. of steps/memory used by an algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Big O notation

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

complexity of algorithms -tips

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

hardware limits

A

-problem requires more computer memory than is feasible
-problem has an exponential complexity = using more processors makes little difference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

tractable problems

A

Any problem, which is solvable in polynomial time or better

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

intractable problem

A

Any problem which cannot be solved in Polynomial time or better

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

computable problem

A

If an algorithm can be constructed to solve a particular problem then that problem is computable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

problems computer can’t do/easily

A

-borad, poorly defined problems
-problems that call for subjective evaluations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

halting problem

A

-Shows that there exists some problem which simply cannot be solved by computers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

turing machine

A

formal model of computation that
consists of a finite state machine , a read/write head and a tape that is infinitely long in one direction.

17
Q

transition function

A
18
Q

importance of universal turing machine

A

-anything a turing machine can compute a computer can
-provides def of what is computable
-genral purpose machine

19
Q

universal turing machine

A

-capable of representing any FSM
-description of FSM to be used is read off same tape as input data and used to process the input data as usual
-act as interpreters,due to the way they read their instructions in sequence before executing operations on input data