Other Flashcards
1
Q
Running a Program
A
- Preprocessor
- Compiler
- Assembler
- Linkage
2
Q
Compiling a Program
A
- Lexical Analysis
- Syntax Analysis
- Semantic Analysis
- Intermediate Language
- Optimization
- Machine Code
3
Q
Static Array
A
- Main feature: Fixed-size array with a predetermined capacity.
- Key point: Cannot be resized after creation, and the size is fixed at compile time. Efficient for small, fixed-size collections.
- Analogy: A set of pigeonholes.
- Explanation: Each pigeonhole has a fixed size and can hold an item. You can’t add more pigeonholes or change their size once they’re set up
4
Q
Stack
A
- Main feature: Last In, First Out (LIFO) data structure.
- Key point: Elements are inserted and removed from the same end (top) of the stack.
- Analogy: A stack of plates.
- Explanation: You can only add or remove plates from the top of the stack. The last plate you put on the stack is the first one you’ll take off.
5
Q
Queue
A
- Main feature: First In, First Out (FIFO) data structure.
- Key point: Elements are inserted at the rear and removed from the front, maintaining the - order in which they were added.
- Analogy: A line at a movie theater.
- Explanation: People join the line (enqueue) at the back and exit the line (dequeue) from the front. The first person to join the line is the first one to enter the theater.
6
Q
Linked List
A
- Main feature: Each element (node) holds a reference to the next element.
- Key point: Efficient for insertion and deletion, as it doesn’t require shifting elements, but less efficient for random access.
- Analogy: A train with carriages linked together.
- Explanation: Each carriage (node) has a link to the next one. You can add or remove carriages without disrupting the rest of the train
7
Q
Vector / Dynamic Array
A
- Main feature: Resizable array that automatically grows or shrinks in size.
- Key point: Provides efficient random access but may require resizing operations, which can be costly in terms of performance.
- Analogy: Imagine it as a warehouse with expandable storage space.
- Explanation: You have a warehouse with a set size. As you add more items, more rooms are opened up to accommodate them. Each item is stored in a specific location, making retrieval efficient. However, if the warehouse becomes completely full, it needs to expand, which could require additional time and resources.
8
Q
List
A
- Main feature: Collection of elements with linear ordering.
- Key point: Allows insertion, removal, and modification of elements at any position within the list.
- Analogy: Think of it like a linked chain of items.
- Explanation: You have a chain where you can add, remove, or rearrange items as needed. Each item is linked to the next one, making it easy to access any item in the chain regardless of its position. Whether you add, remove, or move an item, the chain remains intact, and you can navigate through it smoothly.
9
Q
Preprocessor
A
Append .h into .cpp
10
Q
Compiler
A
Code into assembly
11
Q
Assembler
A
Assembly into machine
12
Q
Linkage
A
Gets library, makes .exe