Essential Computer Science Concepts: OOP, Data & Networking

Object-Oriented Programming (OOP)

  • Derived Class: A class that inherits properties (data and methods) from another class. It represents the “Child” in an inheritance relationship.
  • Base Class: The original class whose properties are inherited by another class. It acts as the “Parent” or “Blueprint.”
  • Constructor: A special member function that is automatically called when an object of a class is created. Its main job is to initialize the object.
  • Destructor: A special member function that is automatically called when an object is destroyed or goes out of scope. It deallocates memory.
  • Copy Constructor: A constructor used to create a new object as a copy of an existing object of the same class.
  • Constructor Overloading: Having multiple constructors in the same class with the same name but different parameters (arguments).
  • Static Data Member: A variable shared by all objects of a class. Only one copy exists in memory, regardless of how many objects are created.
  • Inheritance: The capability of one class to derive properties and characteristics from another class, promoting code reusability.
  • Visibility Mode: Keywords (public, private, protected) that control the accessibility of base class members within the derived class.
  • Encapsulation: The process of wrapping data (variables) and methods (functions) into a single unit called a class.
  • Data Hiding: An OOP technique of hiding internal object details (usually by making data private) to prevent unauthorized access.
  • Scope Resolution Operator (::): An operator used to define a function outside a class or to access a global variable when a local variable has the same name.
  • Reference Variable: An alias or another name for an existing variable. It does not create a new storage location.
  • Global Class: A class defined outside all functions, making it accessible throughout the entire program.
  • Local Class: A class defined inside a specific function, making it accessible only within that function.

Data Structures

  • Stack: A linear data structure that follows the LIFO (Last In, First Out) principle. Operations happen at one end called the “Top.”
  • Queue: A linear data structure that follows the FIFO (First In, First Out) principle. Elements are added at the “Rear” and removed from the “Front.”
  • Linear Data Structure: A structure where data elements are arranged sequentially or linearly, such as Arrays, Stacks, and Queues.
  • Circular Queue: A type of queue where the last position is connected back to the first position to make a circle, preventing memory wastage.
  • Postfix Expression: A mathematical expression where the operator comes after the operands (e.g., AB+ instead of A+B).
  • Binary Search: An efficient searching algorithm that repeatedly divides a sorted list in half to find a target value.
  • Overflow: A condition that occurs when you try to insert an element into a data structure (like a Stack) that is already full.
  • Underflow: A condition that occurs when you try to delete an element from a data structure that is already empty.

Networking

  • Computer Network: A collection of interconnected computers and devices that share resources and information.
  • Internet: A global network of interconnected networks that use the TCP/IP protocol to link billions of devices worldwide.
  • Switch: A networking device that connects devices on a LAN and uses MAC addresses to forward data only to the specific destination device.
  • OSI Model: A 7-layer conceptual framework that standardizes how different computer systems communicate over a network.
  • LAN (Local Area Network): A network covering a small geographical area, like a room, home, or office building.
  • MAN (Metropolitan Area Network): A network that covers a larger area than a LAN but smaller than a WAN, typically spanning a city.
  • WAN (Wide Area Network): A network that spans a large geographical distance, such as a country, continent, or the whole world.
  • Network Topology: The physical or logical arrangement of computers, cables, and other components in a network (e.g., Star, Bus, Ring).
  • Bandwidth: The maximum amount of data that can be transmitted over a network connection in a given amount of time (usually measured in bps).

SQL & File Handling

  • Cartesian Product: An operation that returns all possible combinations of rows from two tables (Table A rows × Table B rows).
  • UNION Operator: An SQL operator used to combine the result sets of two or more SELECT statements (it removes duplicates).
  • Primary Key: A field (or set of fields) that uniquely identifies each record in a database table. It cannot contain NULL values.
  • UNIQUE Constraint: Ensures that all values in a column are different, but unlike a Primary Key, it can accept one NULL value.
  • DEFAULT Constraint: Provides a predefined value for a column if no value is specified during data insertion.
  • NOT NULL Constraint: Ensures that a column cannot have a NULL (empty) value.
  • Text File: A file that stores data as human-readable characters (ASCII/Unicode). It uses EOL (End of Line) characters.
  • Binary File: A file that stores data in the same format it is held in memory (0s and 1s). It is faster and more compact than a text file.

Constructor vs. Destructor Comparison

ConstructorDestructor
Used to initialize an object at the time of creation.Used to clean up/deallocate memory when an object is destroyed.
Has the same name as the class (e.g., Student()).Has the same name as the class preceded by a tilde (e.g., ~Student()).
Can take arguments (can be overloaded).Cannot take any arguments (cannot be overloaded).