• Algorithms 101: DFS and BFS

    Depth-First Search (DFS) and Breadth-First Search (BFS) are two common traversal methods for trees and graphs Tree Traversal Depth-First Search (DFS) is an algorithm that traverses the nodes of a tree by searching the branches as deeply as possible. It traverses the nodes of the tree along its depth, exploring…

  • Python 101: Immutable vs Mutable Objects in Python

    In Python, objects are categorized as either mutable or immutable. Understanding the distinction between these two types of objects is crucial for efficient programming and can profoundly influence your decision when choosing which data type to use in solving a given programming problem. Immutable Objects: Immutable objects do not allow…

  • LeetCode: 124 Binary Tree Maximum Path Sum

    Problem Statement Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path must contain at least one node and does not need…

  • Python 101: Is there a specific reason why lists have append() but not add() in Python

    The distinction between the append() method for lists and the add() method for sets in Python can be attributed to the fundamental differences in the way lists and sets are structured and used. Lists are ordered collections of items, meaning that the items in a list have a specific order,…

  • Python 101: memo = {} vs memo = dict() in Python

    memo = {} vs memo = dict() The choice between memo = {} and memo = dict() in Python can be seen as a matter of personal preference, as both achieve the same result. The {} syntax is a shorthand for creating an empty dictionary, while dict() is the explicit…

  • Learn python this summer Day 9: Lists and List Comprehensions

    Learn python this summer Day 9: Lists and List Comprehensions

    Welcome back! Yesterday, we learned about working with files in Python. Today, we’ll dive into lists and list comprehensions, which are powerful tools for working with collections of data. By the end of this day, you’ll know how to create, manipulate, and use lists efficiently. Let’s get started! What are…

  • Learn python this summer Day 8: Working with Files

    Learn python this summer Day 8: Working with Files

    Welcome back! Yesterday, we learned about modules and packages in Python. Today, we’ll dive into working with files, which is essential for reading from and writing to files in your programs. By the end of this day, you’ll know how to handle files in Python. Let’s get started! Reading Files…

  • Learn Python this summer:Day 7: Modules and Packages

    Learn Python this summer:Day 7: Modules and Packages

    Welcome back! Yesterday, we learned about error handling in Python. Today, we’ll explore modules and packages, which help you organize your code and reuse it across different projects. By the end of this day, you’ll know how to use Python’s built-in modules and create your own. Let’s get started! What…

  • Learn python this summer Day 6: Error Handling

    Learn python this summer Day 6: Error Handling

    Welcome back! Yesterday, we learned about functions in Python. Today, we’ll explore error handling, which is crucial for writing robust and reliable programs. By the end of this day, you’ll know how to handle errors gracefully in your Python programs. Let’s get started! What is Error Handling? Error handling allows…

  • Algorithms 101: commonly used time complexities from smallest to largest

    The order of commonly used time complexities, from smallest to largest, is: O(1) < O(logn) < O(n) < O(nlogn) < O(n^2) < O(n^3) < O(2^n) < O(n!) < O(n^k) This order is determined based on the growth rate of commonly encountered time complexities. Time complexity represents the relationship between the…