By: Sarfraz Raza
TAs: Amin, Ruhma, Ghufran, Umair, Usman, Zain, Sumair
Note: All the Assignments, labs and project documents can be found in instruments
By: Sarfraz Raza
TAs: Amin, Ruhma, Ghufran, Umair, Usman, Zain, Sumair
Note: All the Assignments, labs and project documents can be found in instruments
Other related courses:
ITC: https://sites.google.com/view/itc-ucp-2017
PF/OOP: https://sites.google.com/view/pf-ucp-2018/
DSA: https://sites.google.com/view/dsa-ucp2017/home
DS: https://sites.google.com/view/ds-ucp-2017/home
Algo-2019: https://sites.google.com/view/algo-ucp-2019
Types of Pointers
1. Mutable pointer pointing towards mutable memory
2. Mutable pointer pointing towards immutable memory
3. Immutable pointer pointing towards mutable memory
4. Immutable pointer pointing towards immutable memory
Dynamic Memory Allocation - I
Working with Pointers in C/C++
Snake Game (Single & Multiplayer)
Main Flow - Memory usage of the game
Step by Step division of the game's flow
Divide and Conquer
Internal Implementation Details of UNIT-STEPs
Making Structs of player, snake, and food
Initialization
Moving Snake
Adding Directions
Adding Food
Capturing Food
Generating Food
Discussion on Extending to Multiplayer game
The Story of OOP
Charles Babbage and Ada Lovelace
The Start Of Programming The Advent of Programming Languages
Current Era of Programming
Introdution to classes
Implementing ComplexNumber class
Advantages of using member functions of a class
The mystery of this pointer
Explaining #pragma once and its old implementation
Introduction to Constructors (default and paramiterized)
Abstract Data Type (ADT)
Throw statement
Try catch statement and its advantages
intro to member initialization list
using list initializers to call constructors
Access and utility functions and their uses
Accessing public class members through Objects, References and Pointers
overloaded constructors and delegating constructors
Introduction to Destructors and their importance
static and global variables/objects
Order in which constructors and destructors are called
introduction to Friend functions and its uses
Composition.
A detailed discussion of Composition from Deitel 9th Edition Book.
Static Variables.
How Static variables are not part of any Object?
Applications of static variables.
Static Functions.
How Static variables are not part of any Object?
Why we can't access class members (variables) in Static Function?
Benefits of Static Functions and variables.
Introduction to Friend Functions and Friend Class.
What is Operator Overloading?
Different types of operators (Arithmetic, Relational, Logical, Bitwise, Assignment, Misc)
Bit-wise shifting (<<) applications
Doubling a Number
Changing ith bit of a Number
Changing all bits of a Number
Consequences after writing destructor in a class
Compiler calls '=' operator itself
Dangling Pointers arise due to Bit by Bit Copy of Object
operators overloading functions inside and outside class
cout '<<' operator overloading for class objects
Cascading Effects
Discussion of Huge Integer class
Basic Introduction
Constructor (Allocating memory, increasing and decreasing the size)
Destructor
Using Operator overloading in huge integers for inputting and displaying the huge integers
Loading Huge Integers
Friend functions in huge integers
Overloading [] operator to access specific index of a huge integer
Adding two huge integers
Subtracting two huge integers
Multiplying two huge integers
Quantity-wise addition of huge integers
Quantity-wise subtraction of huge integers
Overloading addition and subtraction operators
Multiplying 2 huge integers
Dividing 2 huge integers
Overloading multiply and divide operators
Introduction to composition
Introduction to Aggregation
Differences between composition and aggregation
Introduction to Association
Differences between composition, aggregation and association
Discussion of multiple examples where each of them should be used
Introduction to inheritance
Introduction to inheritance
• Basic inheritance in C++
• Base and Derived classes
• Order of construction of derived classes
• Constructors and initialization of derived classes
protected access specifiers
difference between public, private and protected inheritance
Creating Calculator using Windows form app in C#
• Use of partially built classes in C#
• Adding components via toolbox
• Creating buttons
• Changing names for buttons
• Read only for text box
• Exploring pre generated source files
• Adding click function for buttons
• Display of numbers
• Basic arithmetic operations
• Upgrading to scientific calculator
• Introduction to recursion
• Understanding function call
• Call stack for function calls
• Factorial of a number using recursion
• Multiplication using recursion
• Inheritance and access specifiers
• Adding new functionality to a derived class
• Calling inherited functions and overriding behavior
• Hiding inherited functionality
• Multiple inheritance
• Pointers and references to the base class of derived objects
• Virtual functions and polymorphism
• The override and final specifiers, and covariant return types
• Virtual destructors, virtual assignment, and overriding virtualization
• Early binding and late binding
• Recap of Polymorphism
• Early and late binding
• Understanding virtual table
• Drawback for polymorphic design
• Pure Virtual functions
• About Abstract classes
• Example of Animal class
• Defining Pure virtual functions
• examples from chess game
• Interface classes
• Revisiting Diamond Problem
• Solving with Virtual Base classes
• Object slicing
Imagining recursion
Stopping criteria for recursion
Problem 1: Printing all bit strings
- Building N length strings from N-1 length strings
Base case for Problem 1
Testing Problem 1 and its complexity
What if we solve it with loops?
Problem 2: Coin Change Problem
Smaller sub-Problems for Problem 2
What are NP Problems
Base case for Problem 2
Testing Problem 2
Problem 3: Subset Sum Problem
Base case for Problem 3
Testing Problem 3
• Template classes
• Template non-type parameters
• Function template specialization
• Class template specialization
• Partial template specialization
• Partial template specialization for pointers
Fibonacci numbers with recursion
Fibonacci numbers with memoization
Dynamic Programming
Tribonacci problem
Divide and Conquer:
Merge Sort
Quick Sort
intro to stl library
containers
-Sequential containers (array, deque, forward_list)
-Ordered associative containers
-Unordered associative containers
-Container Adapters
intro to linked list
how iterators work and their making
Operators overloaded in containers
Common member functions for most Standard Library Containers
Input and output using iterators
All iterators
vector Sequence container
best random access
how vector works in O(n)
shrink_to_fit function
other important functions and their working like:
-begin(), cbegin(), end(), cend(), copy(),
push_back()->O(1), insert()->O(N), erase(), clear() and why these functions are so fast
iterators of different data structures
exception handling in vectors
List data structure
difference in list and vector data structures
merge(), sort(), push_front(), pop_front()
splice() function and how it is different from insert
intro to deque Sequential Container
also called doubly ended queue
why list doesn't give random access
O(1) access in deque when using the subscript operator
When to use vector, lists and deque:
- vector: when inserting only on one side
- list: when splicing is needed
- deque: when inserting on both ends
Intro to circular queue
Starting Associative Containers
They make searching easier
Insertion and searching both taking O(logN)
Intro to sets data structure
-Sorting using Sets
-Problem: it cannot contain repeated values
-Can be used to remove duplicate values
Intro to multiset data structure
-Sorting in O(NlogN)
-Sorting using Multiset solves the problem with sets
Intro to map and multimap data structures
use of sub-scripting and keys in map
intro to Stack data structure
why they are called adapters
Mandatory functions for implementing it
Decimal to Binary conversion
intro to queue data structure
intro to priority_queue data structure
Difference between queue and priority_queue
Templates
Template Specialization (in functions)
Partial Template Specialization (in classes)
Move Semantics
Smart Pointers
Classes in Python
Constructors
Public/Private/Protected Attributes
References and Composition in classes
Inheritance and Polymorphism in Python
Discussion on Paintbrush and its OOP design
Python library for Paintbrush