Computer Science - Paper 1

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

Who made a famous short path algorithm?

1 / 123

flashcard set

Earn XP

124 Terms

1

Who made a famous short path algorithm?

Dijkstra (Dike-Struh)

<p>Dijkstra (Dike-Struh)</p>
New cards
2

What does a shortest path algorithm do?

Finds the shortest path between two nodes in a weight graph.

New cards
3

What are 2 ways to traverse a graph?

  • Breadth

  • Depth

New cards
4

What is Breadth First search?

A node is checked entirely first before moving onto the next.

New cards
5

What is Depth First search?

An entire branch is explored before backtrackingD and truly checking each node.

New cards
6

What are the 3 ways to traverse a tree?

  • Pre-Order

  • In-Order

  • Post-Order

New cards
7

What type of trees are each of the 3 tree traversals meant for?

  • Pre-Order and Post-Order work with any tree.

  • In-Order is mainly meant to be used on Binary trees.

New cards
8

Why do we use Reverse Polish Notation?

  • Eliminates need for brackets.

  • Great use in Stacks

New cards
9

What does the Dijkstra Algorithm do?

Finds the shortest path between two nodes in a graph.

New cards
10

What are 2 sorting algorithms?

  • Bubble

  • Merge

New cards
11

What are 2 Searching Algorithms?

  • Linear

  • Binary

New cards
12

On what list can a Linear search be used?

Linear search can be used on any unordered list.

New cards
13

On what list can a binary search be used?

Binary searches can only be used on ordered lists.

New cards
14

What are the 2 ways RPN can be visualised?

  • Infix

  • Postfix

New cards
15

What are the 4 main Computer Science Constructs?

  • Sequence

  • Selection

  • Iteration

  • Assignment

SSIA

New cards
16

What is meant by Abstraction?

Removal of unrequired information. Keeping only what is necessary.

New cards
17

What is meant by Decomposition?

Breaking down of a problem into smaller and edible chunks.

New cards
18

What is meant by Composition?

The combination. Like composite

New cards
19

What makes up a Turing Machine?

  • Read & Write Head

  • Infinite Tape

  • Finite State Machine (FSM)

New cards
20

What symbol is used to highlight transition functions?

Greek Symbol Delta : δ

<p>Greek Symbol Delta : δ</p>
New cards
21

What is the difference between TM and UTM?

Turing Machine vs Universal Turing Machine is that the UTM can take in another input more than the general TM.

New cards
22

Why is the Turing Machine so important?

The Turing Machine explains the limits of computation as with this theoretical machine if to be impossible with such a machine then its stated to be an incomputable problem. Only provable through use of the Turing Machine

New cards
23

What does FSM stand for?

Finite State Machine

<p>Finite State Machine</p>
New cards
24

What does STD stand for?

State Transition Diagram

New cards
25

What does cardinality mean?

The Count meant to be used on a finite set stating the count within the set.

New cards
26

What does finite mean?

The ability to end.

New cards
27

What does infinite mean?

Unknowingly long.

New cards
28

How do you figure out the cartesian product?

Correct use of multiplication.

<p>Correct use of multiplication. </p>
New cards
29

What is Regular Expression?

Simply put a way of describing a set.

New cards
30

What are the symbols used for Regular Expression?

  • ‘*’ — Meaning zero or more

  • ‘+’ — Meaning one or more

  • ‘?’ — Meaning zero or one repeated (Optional)

  • ‘|’ — Meaning “or“ a choice

  • ‘()’ — Simply just groups them

<ul><li><p>‘*’ — Meaning zero or more</p></li><li><p>‘+’ — Meaning one or more</p></li><li><p>‘?’ — Meaning zero or one repeated (Optional)</p></li><li><p>‘|’ — Meaning “or“ a choice</p></li><li><p>‘()’ — Simply just groups them</p></li></ul>
New cards
31

Can sets contain other sets?

Yes. For those that fit. For example a set containing infinite numbers and one which include 1-10 they’ll defiantly be a set of a set.

New cards
32

What is set comprehension?

Expression of sets through selecting from larger general sets.

<p>Expression of sets through selecting from larger general sets.</p>
New cards
33

What is an empty set called?

{} or Ø

New cards
34

What is a subset?

Example:

A is a subset of B if it only contains items from Set B

Symbol : ⊆

New cards
35

What is a proper subset?

Example:

A is a proper subset of B if it only contains items from B but not all of them

Symbol :

New cards
36

What are the 3 different set operations?

  • Union

  • Intersection

  • Difference

New cards
37

What does Union do considering sets?

Union would take two sets and combine them into a brand new one combining everything from the previous two. (No Duplicates)

Symbol : ∪

New cards
38

What does Intersection do considering sets?

An intersection considering sets when taking two sets the brand new set that would be created would only included those within the previous sets that are found|duplicate in both of them.

Symbol : ∩

New cards
39

What does Difference do considering sets?

When a difference is applied to two sets the resulting brand new set will only include one of the previous in the brand new one completely removing the other.

Example:
A/B
This will only include those from set A

Symbol : /

New cards
40

What does BNF stand for?

Backus-Naur Form

New cards
41

Considering BNF What is the difference between Terminal and Non-Terminals?

Backus-Naur Form considering the difference between Terminal and Non-Terminals:

Terminal — CANNOT be broken down into simpler parts
Non-Terminals — CAN be broken down into simpler parts

New cards
42

Why use BNF?

Backus-Naur form allows for notation of Context free languages.

New cards
43

What does the Halting Problem prove?

The halting problems shows that there are computational problems that are not possible to be solved.

New cards
44

From best to worst-case what are the BigO classifications?

  • O(C)

  • O(log2(n))

  • O(n)

  • O(nlog(n))

  • O(n²)

  • O(n³)

  • O(2^n)

  • O(n!)

<ul><li><p>O(C)</p></li><li><p>O(log2(n))</p></li><li><p>O(n)</p></li><li><p>O(nlog(n))</p></li><li><p>O(n²)</p></li><li><p>O(n³)</p></li><li><p>O(2^n)</p></li><li><p>O(n!)</p></li></ul>
New cards
45

What is meant by Heuristic?

The best guess or rather rule of thumb. Expectation

New cards
46

What is the BigO for a Binary Search?

O(log2 (n))

New cards
47

What is the BigO for a Linear Search?

O(n)

New cards
48

What is the BigO for a Merge Sort?

O(nlog(n))

New cards
49

What is the BigO for a Bubble Sort?

O(n²)

New cards
50

What is the difference between Tractable and Intractable?

The difference to whether a problem can be done within a polynomial amount of time or not.

  • Tractable saying that it CAN.

  • It’s an intractable saying that it CANNOT.

New cards
51

What is the Halting problem?

The unsolvable problem of determining whether any program will eventually stop if given a particular input.

New cards
52

What does Countably Infinite mean?

Its more of statement really which states that all infinite sets can be counted off with use of the natural numbers set (also being infinite) technically meaning every value up to infinity does have a ordinal value.

New cards
53

What counts as a countable set?

  • finite sets

  • countably infinite sets

New cards
54

What are the 4 different types of abstraction?

  • Procedural

  • Functional

  • Data

  • Problem

New cards
55

What are the 7 different Data Structures?

  • Queue

  • Stack

  • Graph

  • Tree

  • Hash Table

  • Dictionary

  • Vector

QuickSilverGoTHDV

New cards
56

What are the 3 types of Queue?

  • Linear

  • Circular

  • Priority

New cards
57

What are Data Structures?

Data Structures act as containers for data acting almost as a next level sort of Data Type.

New cards
58

What are the 3 rules of Arrays?

  • Must be finite

  • Must be indexed

  • Must contain the same data type

New cards
59

What is the difference between 1 and 2 dimensional arrays?

One is simply linear with only data being labelled by its index, while 2 dimensional arrays look like tables containing a column and row.

<p>One is simply linear with only data being labelled by its index, while 2 dimensional arrays look like tables containing a column and row.</p>
New cards
60

What is an abstract data type?

There truly is no such thing as an abstract data type as all it does is take from other real data types and customize themself in their own way making them different to the original only then being labelled as abstract.

New cards
61

How do you interact with queues?

FIFO (First In First Out)

New cards
62

How does a linear queue function?

With use of 2 pointers:

  • Front Pointer

  • Rear Pointer

With these two it will add to the rear (being furthest right) and subtract from the front (being furthest left)

New cards
63

What happens if you reach the end of a linear queue?

CIRCULAR QUEUE!!! in a linear queue it’ll probably just say its full as the pointers always go to the first available space.

Considering a Circular Queue it has the power to go over the edge and loop back round like a circle so if there is space back at the beginning. it can be used.

<p>CIRCULAR QUEUE!!! in a linear queue it’ll probably just say its full as the pointers always go to the first available space.</p><p>Considering a Circular Queue it has the power to go over the edge and loop back round like a circle so if there is space back at the beginning. it can be used.</p>
New cards
64

How does a priority queue work?

Quite similar to that of a weighted graph. Everything is labelled with a value defining its importance in turn saying when it should be dealt with and if there are two of the same variant then simply they are treated as if its a regular queue. (FIFO)

New cards
65

How do you interact with stacks?

FILO (First In Last Out)

New cards
66

How do Stacks work?

Stacks work with a singular pointer known as the top pointer. (Like a stack of books)

New cards
67

What operations can be done on a stack?

  • Push — Adds an item to the stack

  • Pop — Removes an item from the stack

  • Peek — returns the value on top (No Removal)

IsFull , IsEmpty both work.

New cards
68

What are the parts of a graph called?

  • Nodes or Vertices

Get joined together by

  • Edges or Arcs

A Weighted graph has values assigned to these edges.

New cards
69

Instead of using a graph to present what else could be used?

An Adjacency list which displays all the relationships in a different way.

<p>An Adjacency list which displays all the relationships in a different way.</p>
New cards
70

What is the difference between Adjacency Matrix and List?

Adjacency Matrixes store every possible edge there is even if they dont exist with the downside being it takes up more storage while the lists only look at the edges which exist and in turn take up less storage.

  • Adjacency Matrix is better for Dense Graphs

  • Adjacency List is better for Sparse Graphs

New cards
71

What are the 3 rules for trees?

  • Must be Connected

  • Must be an undirected graph

  • must have no cycles.

New cards
72

What makes a root node?

The Root Node is the first node at the top of a tree diagram. These trees contain parents and children.

To be a Root Node you must have no parents.

New cards
73

What is the difference between Trees and Binary Trees?

A Binary tree has no more that 2 children under a single parent.

New cards
74

What do Hash Tables do?

Hash Tables are a way of storing data that allows for it to be retrieved within a constant time complexity.

New cards
75

How do Hash Tables work?

Hash tables take a value and then hash the value masking it with something else and then never again reveal the original input and continue to use the hashed value instead.

New cards
76

How does Dictionary work?

Exactly like it works for compression when a specialized dictionary gets made in order to use duplicates and save entire phrases.

New cards
77

What is the difference between Static and Dynamic?

Static in regard to Data Structures mentions that they are set and final when it comes to questioning the amount of space or rather data they can hold while for dynamic they are able to change their size willingly.

New cards
78

What does sequential mean?

Sequential looks at order stating that one comes after the other.

New cards
79

What is it called if there happens to be too much data in a single structure?

A stack overflow. (An Overflow error)

New cards
80

What does Push do?

Push adds an item to a stack.

New cards
81

What does Pop do?

Pop removes an item from a stack.

New cards
82

What does Peek do?

Without removing anything it will check the top value.

New cards
83

How many pointers does a stack have?

1 — The Top Pointer

New cards
84

How many pointers do queues have?

2 — The Front and Rear Pointers

New cards
85

What are the two things which define Data Types?

  • Values in which they take.

  • The operations which can be performed with them.

New cards
86

What data type can only be true or false?

Boolean

New cards
87

What data type can only accept numbers?

Integer

New cards
88

What data type can only accept one singular input?

Char

New cards
89

What data type can store any other data type?

String

New cards
90

What is meant by assignment?

Providing either a variable or a constant with a value.

New cards
91

What is meant by iteration?

Repeating an instruction.

New cards
92

What is a subroutine?

A subroutine is a named block of code with the mission of being called frequently in order to perform an operation.

New cards
93

What is the difference between Definite and Indefinite?

Definite refers to the amount of iterations having a pre-determined end while indefinite has the possibility to go on for infinity. (or not)

New cards
94

What is indentation?

A incredibly common visual effect that is done to code in order to only make it more visually beneficial with only it having an actual effect once a syntax error has been made.

New cards
95

What does DIV do?

Divides but excludes the remainder.

New cards
96

What does MOD do?

Provides the remainder.

<p>Provides the remainder.</p>
New cards
97

Why is a constant so good at its job?

Overall its easier:

  • Easier to update with it being in the same place to be used globally.

  • With the ability of such a variable able of receiving a name it means that it can be easier to understand.

New cards
98

What is concatenation?

Part of string manipulation where even two or more strings can be connected.

New cards
99

What subroutine must always return a value?

A Function

New cards
100

What can parameters be used for?

Passing data between subroutines.

New cards

Explore top notes

note Note
studied byStudied by 22 people
... ago
5.0(1)
note Note
studied byStudied by 228 people
... ago
5.0(5)
note Note
studied byStudied by 72 people
... ago
5.0(3)
note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 7 people
... ago
5.0(1)
note Note
studied byStudied by 75 people
... ago
5.0(1)
note Note
studied byStudied by 2 people
... ago
5.0(1)
note Note
studied byStudied by 43 people
... ago
5.0(3)

Explore top flashcards

flashcards Flashcard (90)
studied byStudied by 13 people
... ago
5.0(1)
flashcards Flashcard (112)
studied byStudied by 3 people
... ago
5.0(1)
flashcards Flashcard (37)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (88)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (59)
studied byStudied by 17 people
... ago
5.0(1)
flashcards Flashcard (62)
studied byStudied by 9 people
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (158)
studied byStudied by 2 people
... ago
5.0(1)
robot