Category: Data Structure
-
List and Array in Python
The List is one of the built-in data type in Python. The four collection data types are: list, tuple, set and dictionary.
-
Stacks, Queues, and Linked Lists in Python
When preparing for python coding interviews, three of the most common data structures you'll need to know are stacks, queues and linked lists interviewers love them because they test your understanding of memory, order of operations and problem-solving.
In this post, we will:
- Explain each data structure in simple terms.
- Show how to implement them from scratch in python.
- Solve a few classic mini-problems you might see in interviews.
Let's dive in đ
-
Mutable and Immutable types in Python
đˇ Introduction
If you're preparing for Python coding interviews, you've probably heard the terms mutable and immutable. They may sound abstract, but they play a huge role in how Python works under the hood, and understanding them can save you from subtle bugs.
in this post, we'll explore: * What mutability means in Python * Which built-in types are mutable vs immutable * Common interview pitfalls * Why this concept matters for writing clean, efficient âĻ
-
Lists vs Tuples vs Sets vs Dictionnaries in Python
đˇ Introduction
If you're preparing for a Python coding interview, one of the first questions you'll face is:
"Wich data structure would you use for this problem, and why?"
Python offers four fundamental built-in data structures: * List - ordered, mutable sequence. * Tuple - ordered, immutable sequence. * Set - unordered, unique elements. * Dictionary - key-value mapping.
At first glance, they might feel interchangeable. But choosing the right one can mean âĻ
-
Memory Allocation in Python: Assignment vs Copy vs Deepcopy
When working with collections in Python, such as lists, dictionaries, sets, and custom objects, it's crucial to understand memory allocation. By the end of this article, you'll know the difference between assignment, shallow copying, and deep copying. You'll also be able to identify their implications on memory usage, object mutability, and time complexity.