Computeer Science Mock Exam

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/73

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

74 Terms

1
New cards

Sequence

Instructions executed one after another in a fixed order.

2
New cards

Selection (Branching)

A programming construct that chooses which path to follow based on a condition.

3
New cards

Condition

A Boolean expression that evaluates to TRUE or FALSE.

4
New cards

IF statement

Used in selection to run code only if a condition is TRUE.

5
New cards

Iteration

The process of repeating a block of code.

6
New cards

Loop

A structure that repeats code until a condition is met.

7
New cards

Count-controlled loop

A loop that runs a fixed number of times.

8
New cards

Condition-controlled loop

A loop that continues while a condition is TRUE.

9
New cards
10
New cards

Recursion

A programming technique where a function calls itself.

11
New cards

Base case

The condition that stops a recursive function from calling itself.

12
New cards

Stopping condition

The simplest case where a recursive function returns a result.

13
New cards

How recursion works

The function repeatedly calls itself with smaller inputs until the base case is reached.

14
New cards

Stack overflow

An error caused when a recursive function has no stopping condition and uses too much memory.

15
New cards

Recursion advantage

Code is often shorter and clearer for problems like trees.

16
New cards

Recursion disadvantage

Uses more memory and is harder to debug than iteration.

17
New cards

Iteration advantage

More efficient and easier to understand and debug.

18
New cards

Iteration disadvantage

Can require more code than a recursive solution.

19
New cards
20
New cards

Global variable

A variable declared outside all functions and accessible throughout the program.

21
New cards

Local variable

A variable declared inside a function and only accessible within that function.

22
New cards

Variable scope

The part of a program where a variable can be accessed.

23
New cards
24
New cards

IDE (Integrated Development Environment)

Software that allows programmers to write edit run and debug code in one place.

25
New cards

IDE benefit

Improves efficiency by combining multiple development tools.

26
New cards
27
New cards

Array

An ordered static data structure that stores elements of the same data type.

28
New cards

Static data structure

A data structure with a fixed size.

29
New cards

2D array

An array arranged in rows and columns like a table.

30
New cards

3D array

Multiple 2D arrays arranged together like pages in a spreadsheet.

31
New cards

Record

A data structure made up of fields that store different data types.

32
New cards

Field

An individual piece of data within a record.

33
New cards

List

A dynamic data structure that can store duplicate values.

34
New cards

List memory storage

List elements are stored non-contiguously in memory.

35
New cards

Tuple

An ordered collection of values that is immutable.

36
New cards

Immutable

Data that cannot be changed after it is created.

37
New cards
38
New cards

Linked list

A dynamic data structure made of nodes connected by pointers.

39
New cards

Node

An item in a linked list containing data and a pointer.

40
New cards

Pointer

A reference to the memory location of the next node.

41
New cards

Linked list advantage

Items can be added or removed easily without shifting data.

42
New cards

Traversing a linked list

Following pointers from the first node until the end of the list.

43
New cards
44
New cards

Stack

A data structure that uses Last In First Out (LIFO).

45
New cards

Push

Adding an item to the top of a stack.

46
New cards

Pop

Removing an item from the top of a stack.

47
New cards

Stack pointer

Points to the top of the stack.

48
New cards
49
New cards

Queue

A data structure that uses First In First Out (FIFO).

50
New cards

Enqueue

Adding an item to the back of a queue.

51
New cards

Dequeue

Removing an item from the front of a queue.

52
New cards

Head pointer

Points to the front of the queue.

53
New cards

Tail pointer

Points to the end of the queue.

54
New cards

Queue overflow

Attempting to add an item to a full queue.

55
New cards

Linear queue

A queue implemented using an array that does not reuse freed space.

56
New cards

Circular queue

A queue where the array wraps around to reuse space.

57
New cards
58
New cards

Tree

A non-linear data structure made up of nodes and edges.

59
New cards

Root node

The top node of a tree.

60
New cards

Leaf node

A node with no children.

61
New cards

Binary tree

A tree where each node has at most two children.

62
New cards

Binary search tree (BST)

A tree where left child values are smaller and right child values are larger.

63
New cards

Tree traversal

The process of visiting all nodes in a tree.

64
New cards

Post-order traversal

Left subtree right subtree then root.

65
New cards

Adding to a BST

Smaller values go left and larger values go right.

66
New cards

Removing a leaf node

The node is simply deleted.

67
New cards

Removing a node with one child

The node is replaced by its child.

68
New cards

Removing a node with two children

The node is replaced with the smallest value in the right subtree or largest in the left subtree.

69
New cards
70
New cards

Hash table

A data structure that stores key-value pairs using a hash function.

71
New cards

Hash function

Maps a key to an index in a hash table.

72
New cards

Collision

When two keys generate the same hash value.

73
New cards

Collision resolution (OCR)

The data is placed in the next available space.

74
New cards

Good hash function

Produces few collisions and distributes data evenly.