Computer Science Concepts Flashcards

(32 cards)

1
Q

What is a data structure?

A

A way of organizing and storing data so it can be used efficiently.

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

Why are data structures important?

A

They make programs faster, more efficient, and easier to manage.

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

What is an array?

A

A list-like data structure that stores items in a specific order and allows access by index.

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

What is an example of an array?

A

A list of numbers like [2, 4, 6, 8] where each element has a position (index).

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

What are the advantages of arrays?

A

Fast access to elements by position and easy iteration.

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

What are the disadvantages of arrays?

A

Fixed size in some languages and slow insertion/deletion in the middle.

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

What is a stack in computer science?

A

A data structure that follows the “Last In, First Out” (LIFO) rule — the last item added is the first removed.

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

What is an example of a stack in real life?

A

A stack of plates — you take the top plate off first.

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

What are common stack operations?

A

push (add an item) and pop (remove the most recent item).

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

What is a queue?

A

A data structure that follows the “First In, First Out” (FIFO) rule — the first item added is the first removed.

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

What’s a real-life example of a queue?

A

A line at a store checkout — first person in line gets served first.

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

What are common queue operations?

A

enqueue (add to the back) and dequeue (remove from the front).

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

What’s the difference between a stack and a queue?

A

A stack removes the newest item first; a queue removes the oldest item first.

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

What does “Big-O notation” measure?

A

How the performance (speed or memory use) of an algorithm changes as data size grows.

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

Why does Big-O matter?

A

It helps compare which algorithms are more efficient and scalable.

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

What does O(1) mean?

A

Constant time — the operation takes the same amount of time no matter the data size.

17
Q

What does O(n) mean?

A

Linear time — the time grows in direct proportion to the size of the data.

18
Q

What does O(n²) mean?

A

Quadratic time — time increases much faster as the data grows (like nested loops).

19
Q

What is the goal when analyzing algorithms with Big-O?

A

To find the most efficient approach possible for large-scale data.

20
Q

What is a compiler?

A

A program that translates human-written code (high-level) into machine code before running it.

21
Q

What is an interpreter?

A

A program that reads and executes code line by line without pre-compiling.

22
Q

What’s a key difference between compilers and interpreters?

A

Compilers translate all at once; interpreters translate on the fly as the program runs.

23
Q

Give an example of a compiled language.

24
Q

Give an example of an interpreted language.

A

Python or JavaScript.

25
What is abstraction in computer science?
Simplifying complex systems by hiding unnecessary details.
26
Why is abstraction useful?
It helps focus on what something does instead of how it works internally.
27
Give a simple example of abstraction.
You use a “print” command without needing to know how the printer physically works.
28
What is computational thinking?
A problem-solving approach that uses logic, patterns, and step-by-step reasoning like a computer scientist.
29
What are the main parts of computational thinking?
Decomposition, pattern recognition, abstraction, and algorithm design.
30
What is decomposition?
Breaking a big problem into smaller, manageable parts.
31
What is pattern recognition?
Spotting similarities or trends that can simplify a problem.
32
How does computational thinking help in everyday life?
It improves logical reasoning, organization, and efficiency in problem-solving — not just in coding.