Found 26504 Articles for Server Side Programming

polar() function for complex number in C++

sudhir sharma
Updated on 17-Apr-2020 08:59:48

806 Views

The polar function of complex numbers is used to return a complex number.The polar() function is defined in the complex header file in c++. It takes the magnitude and phase angle of a complex number and generates a complex number using these values.Syntaxpolar(mag, phase);Parameters − it takes two values are parameters, the phase, and magnitude of the complex number to be generated.Return value − the function returns a complex number.polar(0.2, 0.5) -> (0.175517,0.0958851)Example Live Demo#include #include>complex.h> using namespace std; int main () {    cout

multiset equal_range() function in C++ STL

Sunidhi Bansal
Updated on 17-Apr-2020 09:00:34

240 Views

In this article we will be discussing the working, syntax and examples of multiset::equal_range() function in C++ STL.What is a multiset in C++ STL?Multisets are the containers similar to the set container, meaning they store the values in the form of keys same like a set, in a specific order.In multiset the values are identified as keys as same as sets. The main difference between multiset and set is that the set has distinct keys, meaning no two keys are the same, in multiset there can be the same keys value.Multiset keys are used to implement binary search trees.What is ... Read More

Policemen catch thieves in C++

sudhir sharma
Updated on 17-Apr-2020 08:57:56

722 Views

In this problem, we are given an array of n elements. Each element of the array has either a policeman or a thief, one thief can be caught by one police and we have to find the maximum number of thieves that can be caught by the police if a policeman can catch a thief k units away from him.Let’s take an example to understand the problem, Input −array = {T, P, P, P, T , T, T} K = 2.Output − 3Explanation − here, each policeman will catch a thief, P at index 1 will catch T at index ... Read More

multiset crbegin() and crend() function in C++ STL

Sunidhi Bansal
Updated on 17-Apr-2020 08:57:53

133 Views

In this article we will be discussing the working, syntax and examples of multiset::crbegin() and multiset::crend() function in C++ STL.What is a multiset in C++ STL?Multisets are the containers similar to the set container, meaning they store the values in the form of keys same like a set, in a specific order.In multiset the values are identified as keys as same as sets. The main difference between multiset and set is that the set has distinct keys, meaning no two keys are the same, in multiset there can be the same keys value.Multiset keys are used to implement binary search ... Read More

Policy-based data structures in g++

sudhir sharma
Updated on 17-Apr-2020 08:55:21

382 Views

g++ compiler is a C++ compiler for GNU in Linux.The g++ compiler also adds support for some special data structures that are not in C++ programming language standard library. These are known as policy-based data structures.The policy-based data structures provide the programmer a high-performance, semantic safety and flexibility as compared to the standard data structures of C++ std library.To include these data structures to your program, the following lines should be added, #include using namespace __gnu_pbds;ExampleLet’s see a program to see how these policy-based data structures work. Live Demo#include #include #include #include using namespace __gnu_pbds; using ... Read More

multiset cbegin() and cend() function in C++ STL

Sunidhi Bansal
Updated on 17-Apr-2020 08:52:57

149 Views

In this article we will be discussing the working, syntax and examples of multiset::cbegin() and multiset::cend() function in C++ STL.What is a multiset in C++ STL?Multisets are the containers similar to the set container, meaning they store the values in the form of keys same like a set, in a specific order.In multiset the values are identified as keys as same as sets. The main difference between multiset and set is that the set has distinct keys, meaning no two keys are the same, in multiset there can be the same keys value.Multiset keys are used to implement binary search ... Read More

Polybius Square Cipher in C++

sudhir sharma
Updated on 17-Apr-2020 08:52:57

986 Views

In this problem, we are given a string and we have to find its integer encryption using the Polybius Square Cipher.Polybius Square CipherIt is a table that is used for the conversion of letters into numbers. The table for English encryption is a 5X5 table i.e. contains 25 cells for 26 alphabets of an English dictionary. The letters i and j are kept together in a single cell.The following table shows a Polybius square Cipher −123451ABCDE2FGHI, JK3LMNOP4QRSTU5VWXYZThe letter of the tables can be randomized. Also, the size of the table can be changed based on the number of alphabets of ... Read More

Popular tools for data analytics in C++

sudhir sharma
Updated on 17-Apr-2020 08:43:26

366 Views

Data analytics is the processing of data to extract useful information that supports the machine to make decisions. The processing of data involves cleaning, remodeling, and inspecting data.Data analytics requires high computing power as the data to process is too large. So there are specialized tools for data analytics.Some popular data analytics tools are −R programmingR is one of the best and most widely used tools for data analytics available for all major platforms like Windows, macOS, Unix. It has found usage in data modeling and statistics. Easily manipulation and representation of large data are done using R as it ... Read More

Populate Inorder Successor for all nodes in C++

sudhir sharma
Updated on 17-Apr-2020 08:38:47

270 Views

In this problem, we are given a tree. The structure contains a pointer next. Our task is to populate this pointer with the inorder successor of the node.struct node {    int value;    struct node* left;    struct node* right;    struct node* next; }All the next pointer are set to NULL and we have to set the pointer to the inorder successor of the node.Inorder traversal − This traverses in the following form, Left node -> root Node -> right node.Inorder successor − the inorder successor is the node that comes after the current node is the inorder ... Read More

Portable applications in Cloud and their barriers in C++

sudhir sharma
Updated on 17-Apr-2020 08:16:23

256 Views

Cloud Computing − cloud computing or internet-based computing is storing and accessing of data on virtual servers that are hosted over internet on cloud servers instead of local server.Cloud computing provides the user with an option to use the data on the go. This increases the portability of work i.e. the data and processing of cloud computing can be used anywhere by the user. This is not device and location specific.This feature of cloud computing is important for corporates as they can use cloud services to run projects from virtual locations. The services like IAAS, PAAS, SAAS are used to ... Read More

Advertisements