Data structure q1

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:25 PM on 2/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

19 Terms

1
New cards

What is a Data Structure?

specialized container that organizes info so it’s efficient. includes element types, set of rules, and operations

2
New cards

What are the requirements for a good algorithm?

correct (stops, gives right answer) and efficient (fast and low memory usage)

3
New cards

What is the difference between i++ and ++i?

uses the value then increments; increments then uses it.

4
New cards

What does the bitwise AND (&) operator do?

compares each bit of two var; returns 1 if both are 1.

5
New cards

What is the purpose of the void data type?

used for functions that do not return a value

6
New cards

How do you declare a constant in C++?

using the const keyword to make a var read-only

7
New cards

What is the ternary operator shorthand (?:) for?

if-else statement; int v = (x < y ? x : y) ;

8
New cards

What is the difference between break and continue?

break exits the loop; continue skips current iteration, moves to the next.

9
New cards

What is Operator Overloading?

Defining standard operators (like ==, +, =) for user-defined types like classes or structures

10
New cards

Static vs. Dynamic Arrays

fixed size set at compile ; use pointers and new operator for runtime sizing.

11
New cards

How do you create and write to a file in C++?

ofstream class from library (insertion operator (<<))

12
New cards

What is a Class Constructor?

A special method; same name as class; automatically called when object called, used to initialize attributes

13
New cards

What is Inheritance?

When a child class inherits attributes and methods from a parent.

14
New cards

Can a subclass access private members of its parent?

No, only public and protected members.

15
New cards

What is Function Overriding?

Redefining a parent class's method in a child class

16
New cards

switch statement

selects one of many code blocks based on a var's value

17
New cards

Do/ while loop

Executes code block at least once before checking the condition (repeat if true)

18
New cards

How to read from a file

ifstream; getline() fetch line from the file

19
New cards

copy constructor

class name, object ( object copied)