Vectors & STL Basics

Work with dynamic arrays that grow and shrink. Learn vectors, the most used container in C++, and start exploring the Standard Template Library.

48 lessons
192 min

Lessons

1. Intro

Why vectors matter

4m

2. What is a Vector?

Understanding vector basics

4m

3. Including the Vector Header

Getting started

4m

4. Creating Vectors

Declaration syntax

4m

5. Quiz: Vector Basics

Vector creation

2m1 problems

6. Vector Initialization

Starting with values

4m

7. Accessing Elements

Reading vector values

4m

8. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

9. Vector Size and Capacity

How vectors manage space

4m

10. Adding Elements

Growing your vector

4m

11. Removing Elements

Shrinking your vector

4m

12. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

13. Inserting and Erasing

Precise modifications

4m

14. Clearing Vectors

Starting fresh

4m

15. Iterating Over Vectors

Processing each element

4m

16. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

17. Range-Based For Loops

Cleaner iteration

4m

18. Vectors and Functions

Function parameters

4m

19. Passing by Reference

Avoiding copies

4m

20. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

21. 2D Vectors

Creating grids

4m

22. Common Vector Operations

Handy shortcuts

4m

23. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

24. Sorting Vectors

Using the sort function

5m

25. Problem: Finding Maximum

Practice with vectors

4m1 problems

26. Problem: Removing Duplicates

Practice with vectors

4m1 problems

27. Problem: Counting Occurrences

Practice with vectors

4m1 problems

28. Quiz: Vector Problems

Test your understanding

3m1 problems

29. Problem: Reversing a Vector

Practice with vectors

4m1 problems

30. Problem: Sum of Elements

Practice with vectors

4m1 problems

31. Problem: Building Dynamically

Practice with vectors

4m1 problems

32. Vector vs Array

Comparing containers

4m

33. Common Mistakes

Typical errors

4m

34. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

35. Performance Tips

Optimization basics

4m

36. Problem - Xenia and Ringroad

Planning a route

4m1 problems

37. Xenia - The Pattern

Circular arithmetic

4m

38. Xenia - Algorithm

Breaking it down

5m

39. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

40. Xenia - Implementation

Complete solution

7m1 problems

41. Lessons from Xenia

summary

4m

42. Problem - Dragons

Choosing opponents

4m1 problems

43. Dragons - The Pattern

Weakest first

5m

44. Dragons - Algorithm

Breaking it down

5m

45. Quiz: Dynamic arrays

Dynamic arrays

3m1 problems

46. Dragons - Implementation

Complete solution

7m1 problems

47. Lessons from Dragons

summary

4m

48. Section Recap

What we learned

5m

Ready to start learning?

Access all 48 lessons with interactive content and progress tracking.