Coding
Python Array
In the programming language or computer science, an array is defined as the form of a data structure which consists of or store collection of various types of elements inside it. Each element present in Read more…
In the programming language or computer science, an array is defined as the form of a data structure which consists of or store collection of various types of elements inside it. Each element present in Read more…
In this section of the Python tutorial, we will look at the introduction of the matrix in Python programming. We will perform many operations on the Python matrix using the in-built functions given in Python. Introduction Read more…
A triangulation of a convex polygon results in a set of non-intersecting diagonals between non-adjacent vertices, which completely partition the interior of the convex hull of the polygon into triangles. The minimum weight triangulation (MWT) Read more…
Given a list containing future price predictions of two different stocks for the next n-days, find the maximum profit that can be earned by selling the stocks with a constraint that the second stock can Read more…
Given a sorted integer array, find the k closest elements to x in the array where k and x are given positive integers. The integer x may or may not be present in the input Read more…
Suppose you are given n red and n blue water jugs, all of different shapes and sizes. All red jugs hold different amounts of water, as do the blue ones. Moreover, there is a blue Read more…
Given an m-ary tree, write an efficient algorithm to convert the tree to its mirror. An m-ary tree (aka k-ary tree) is a tree in which each node has no more than m children. Each Read more…
Given an array of integers, trim it such that its maximum element becomes less than twice the minimum, return the minimum number of removals required for the conversion. For example, The idea is straightforward and Read more…
Given an undirected graph, check whether it has an Eulerian path or not. In other words, check if it is possible to construct a path that visits each edge exactly once. An Eulerian trail is Read more…
Given an array of integers, find the next greater element for every element in the array. The next greater element of a number x is the first greater number to the right of x in Read more…