
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

558 Views
"Madam" or "racecar" are two words that read the same backward as forwards, called palindromes.If we are given a collection or list of strings, we have to write a C++ code to find out if that can join any two strings in the list together to form a palindrome or not. If any such pair of strings exist in the given list, we have to print "Yes, " else we have to print "No."In this tutorial, input will be an array of strings, and output will be a string value accordingly, for exampleInputlist[] = {"flat", "tea", "chair", "ptalf", "tea"}OutputYesThere is ... Read More

2K+ Views
The series.expanding() method is one of the window methods of pandas and it Provides expanding transformations. And it returns a window subclassed for the particular operation.The parameters for this method are min_periods, center, axis, and method. The default value for the min_periods is 1 and it also takes an integer value. The center parameter takes a boolean value and the default one is False. In the same way, the default value for the axis parameter is 0, and for the method is ‘single’.Example 1In this following example, the series.expanding() method calculated the cumulative sum of the entire series object# importing ... Read More

2K+ Views
The pandas series.ffill() method works equal to the series.fillna() with “method = ffill” function or we can say that the series.ffill() is a synonym for the forward fill method.The series.ffill() method replaces the Nan or NA values in the given series object using the forward fill method. The parameters for this method are inplace, axis, limit, and downcast.It does not have parameters like value and method. Because it takes the series element as a replacement value and fills the missing values using the forward fill method.Example 1In this following example, we have applied the ffill() method to the series object ... Read More

459 Views
In a binary tree, there are only two nodes (left and right) in each child node. Tree structures are simply representations of data. Binary Search Trees (BSTs) are special types of Binary Trees that meet these conditions −Compared to its parent, the left child node is smallerThe parent node of the right child is larger than the child nodeSuppose we're given a binary tree, and we are supposed to find out what's the largest binary search tree (BST) within it.In this task, we will create a function to find the largest BST in a binary tree. When the binary tree ... Read More

17K+ Views
In the process of pandas data cleaning, replacing missing values takes a very important role and in some conditions we must replace those missing values with the mean of series elements. This can be done by using the fillna() method.The basic operation of this pandas series.fillna() method is used to replace missing values (Nan or NA) with a specified value. Initially, the method verifies all the Nan values and replaces them with the assigned replacement value.Example 1Here we will see how the series.fillna() method replaces the missing value with mean.# importing pandas package import pandas as pd import numpy as ... Read More

4K+ Views
A spanning tree is a linked and undirected graph subgraph that connects all vertices. Many spanning trees can exist in a graph. The minimum spanning tree (MST) on each graph is the same weight or less than all other spanning trees. Weights are assigned to edges of spanning trees and the sum is the weight assigned to each edge. As V is the number of vertices in the graph, the minimum spanning tree has edges of (V - 1), where V is the number of edges.Finding minimum spanning tree using Kruskal’s algorithmAll of the edges should be arranged in a ... Read More

138 Views
To evaluate a 2D Legendre series at points x, y, use the polynomial.legendre.legval2d() method in Python Numpy. The method returns the values of the two dimensional Legendre series at points formed from pairs of corresponding values from x and y.The 1st parameter is x, y. The two dimensional series is evaluated at the points (x, y), where x and y must have the same shape. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and if it isn’t an ndarray it is treated as a scalar.The 2nd parameter ... Read More

283 Views
To evaluate a 2D Legendre series at points x, y, use the polynomial.legendre.legval2d() method in Python Numpy. The method returns the values of the two dimensional Legendre series at points formed from pairs of corresponding values from x and y.The 1st parameter is x, y. The two dimensional series is evaluated at the points (x, y), where x and y must have the same shape. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and if it isn’t an ndarray it is treated as a scalar.The 2nd parameter ... Read More

157 Views
To evaluate a Legendre series at points x, use the polynomial.legendre.legval() method in Python Numpy. The 1st parameter is x. If x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. In either case, x or its elements must support addition and multiplication with themselves and with the elements of c.The 2nd parameter, C, an array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n]. If c is multidimensional the remaining indices enumerate multiple polynomials. In the two dimensional case the ... Read More

3K+ Views
The pandas series.fillna() method is used to replace missing values with a specified value. This method replaces the Nan or NA values in the entire series object.The parameters of pandas fillna are as follows −Value − it allows us to specify a particular value to replace Nan’s, by default it takes None.Method − it is used to fill the missing values in the reindexed Series. It takes any of these values like ‘backfill’, ‘bfill’, ‘pad’, ‘ffill’, and None(default).Inplace − this parameter takes a boolean value. If it takesTrue, then the modifications are applied to the original series object itself, otherwise, ... Read More