We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Tag: Remove

Remove all occurences of an element from vector in O(n) complexity

Suppose we have a vector of integers and we want to delete all occurences of a number from it i.e. Let’s say vector contain following numbers 1,2,5,4,5,1,5,7,8,9. Now we want to delete all the occurences of 5 from it, so that vector contents should become – 1 2 4 1 7 8 9 . Also …

Remove all occurences of an element from vector in O(n) complexityRead More

How to remove elements from a List based on value or External Criterion

In this article we will discuss how to remove an element from a List by matching a value or by matching some criterion. std::list provides two member functions for removing elements based on value i.e. std::list::remove and std::list::remove_if. Advertisements Using std::list::remove to remove element by value void remove (const value_type& val); It removes all the elements …

How to remove elements from a List based on value or External CriterionRead More

How to Erase / Remove an element from an unordered_map

In this article we will discuss the different ways to remove an element from an unordered_map. Unordered_map provides different overloaded version of erase() member function to delete key value pairs from map. Advertisements Erasing an element from an unordered_map by key Unordered_map provides following overloaded version of erase() that accepts a key by value and …

How to Erase / Remove an element from an unordered_mapRead More

Java : How to Remove elements from HashMap while Iterating

In this article we will discuss different ways to remove elements from HashMap while Iterating. Let’s create a HashMap of String as Key and Integer as value and add some elements into it i.e. Advertisements // Create a HashMap of string and int HashMap<String, Integer> wordFreqMap = new HashMap<>(); // Add elements in Map wordFreqMap.put(“this”, …

Java : How to Remove elements from HashMap while IteratingRead More

Python : How to Remove multiple keys from Dictionary while Iterating ?

In this article we will discuss how to remove multiple key / value pairs from dictionary while iterating. Suppose we have a dictionary of string and int i.e. Advertisements # Dictionary of strings wordFreqDic = { “Hello”: 51, “at” : 23 , “test” : 33, “here” : 63, “start” : 13 } Now we want …

Python : How to Remove multiple keys from Dictionary while Iterating ?Read More

Cart

Your Cart is Empty

Back To Shop