Tag: From
HEALTH-PLANET: Why Buy From Our Online Supplements Store
General Health Blog HEALTH-PLANET: Why Buy From Our Online Supplements Store herbal supplements HEALTH-PLANET Natural Solutions, the leading online supplements store for Natural Health products. The question is are we really the leading online store for everything related to natural health products? Am sure this is probably the question in your mind. We believe this …
HEALTH-PLANET: Why Buy From Our Online Supplements StoreRead More
Insomnia And Sleep Problem: Relief From Insomnia With Natural Sleep Aid
General Health Blog Insomnia And Sleep Problem: Relief From Insomnia With Natural Sleep Aid Insomnia And Sleep Problem, Sleep Natural Solutions To Insomnia And Sleeping Problem There are many natural ways to combat sleep problems and insomnia. Insomnia And Sleep Problem is a common problem affecting the lives of many people. It’s not just the sleepless …
Insomnia And Sleep Problem: Relief From Insomnia With Natural Sleep AidRead More
Create a Singly Linked List from an array
Suppose we have an int array and we want to create it into a singly linked list from it. Singly Linked List Our Node structure is, Advertisements struct node { Â Â Â int value; Â Â Â node * nextPtr;Â Â Â Â Â Â node(int val) Â Â Â { Â Â Â Â Â Â value = val; Â Â Â Â Â Â nextPtr = NULL;Â Â Â Â Â …
Remove Duplicate Elements from a Sorted Singly Linked List
Lets remove all duplicate elements from a sorted singly linked list. For example, Advertisements Suppose given linked list contains following elements in given order, 1, 2, 3, 4, 4, 5, 6, 7, 7, 7, 7, 9, 89 Frequently Asked: Reverse a Singly Linked List in a Single Iteration Create a Singly Linked List from an …
Remove Duplicate Elements from a Sorted Singly Linked ListRead More
Create a Binary Search Tree from an array
Lets discuss how to create a BST From an array. Advertisements Tree’s node structure is as follows, typedef struct node { int value; node * pLeft; node * pRight; node(int val = 0) { value = val; pRight = NULL; pLeft = NULL; } }node; Now create a getBST function that accepts an integer pointer …
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
C++11 Multithreading – Part 8: std::future , std::promise and Returning values from Thread
A std::future object can be used with asych, std::packaged_task and std::promise. In this article will mainly focus on using std::future with std::promise object. Many times we encounter a situation where we want a thread to return a result. Advertisements Now question is how to do this? Lets take an example, Frequently Asked: C++11 Multithreading – …
Initializing a HashSet from an Array or a Collection
In this Article we will discuss how to initialize a HashSet using a Array or a Collection. HashSet has a Constructor that receives a Collection as an argument and initializes the new Set with the elements of passed collection object. Advertisements public HashSet(Collection<? extends E> c) Initializing a HashSet with an array Suppose we need to …
Initializing a HashSet from an Array or a CollectionRead 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 remove elements from a List while Iterating
In this article we will see how to delete an element from a list while iterating through it. Removing Elements From a List while Iterating through it std::list provides a member function erase() that accepts an iterator and deletes the element pointed by that Iterator. But it makes that iterator invalid i.e. we cannot use …