Uncategorized

Python: Delete specific characters from a string

In this article, we will discuss different ways to remove specific characters from a string in python. For example, we have a string, And we want to delete all occurrences of some specific characters from the string. These specific characters are, ‘&’ ‘#’ ‘@’ ‘!’ ‘;’ ‘,’ ‘:’ ‘\” After removing these specific characters from […]

Python: Delete specific characters from a string Read More »

Python- Find the largest file in a directory

In this article, we will discuss how to find the largest file in a directory and its sub-directories using python. Table of contents Find the largest file in a directory using python. Find the largest file in a directory and its sub-directories using python. Get the largest file in a directory using python In python,

Python- Find the largest file in a directory Read More »

Using STL to verify brackets or parentheses combination in an expression

In this we will see how to check if a given string take valid combination of open and close brackets i.e. (4+{8-[22+8]*}] contains valid order of open and close brackets. ({5+8]) contains invalid combination of open and close brackets. [showads ad=inside_post] Bracket combinations to be used, { , } [,] (,) Algo Used:   Create a empty stack of characters Traverse

Using STL to verify brackets or parentheses combination in an expression Read More »

What is weak_ptr in Modern C++ & why do we need it?

In modern C++ programming, smart pointers provides automatic memory management. Among these smart pointers, shared_ptr is widely used because it takes care of releasing memory when it is no longer needed, thanks to reference counting. However, misusing shared_ptr can lead to issues like memory leaks, especially in complex data structures such as binary trees. Let’s

What is weak_ptr in Modern C++ & why do we need it? Read More »

How not to use Smart Pointers in C++?

In modern C++, std::shared_ptr is a smart pointer that manages shared ownership of a dynamically allocated object. It is part of the C++ Standard Library’s memory header. Shared pointers keep track of how many objects own a particular resource and automatically delete the resource when there are no owners left. However, if not used carefully,

How not to use Smart Pointers in C++? Read More »

Scroll to Top