To solve a problem in which we are given an array and some queries. Now in each query, we are given a range. Now we need to find a number such that the sum of their xor with x is maximized, for exampleInput : A = {20, 11, 18, 2, 13} Three queries as (L, R) pairs 1 3 3 5 2 4 Output : 2147483629 2147483645 2147483645In this problem, we are going to take a prefix count of 1’s present in the numbers at each position now as we have precalculated our number of ones, so for finding the ... Read More
Given an N-ary tree and we are tasked to find the total number of ways to traverse this tree, for example −For the above tree, our output will be 192.For this problem, we need to have some knowledge about combinatorics. Now in this problem, we simply need to check all the possible combinations for every path and that will give us our answer.Approach to Find the SolutionIn this approach, we simply need to perform a level order traversal and check the number of children each node has and then simply multiply its factorial to the answer.ExampleC++ Code for the Above ... Read More
To solve a problem in which n − the number of people now each person can either be single or be present in a pair, so we need to find the total number of ways these people can be paired up.Input : 3 Output: 4 Explanation : [ {1}, {2}, {3}, ], [{1, 2}, {3}], [{1}, {2, 3}], [{1, 3}, {2}] these four ways are the only ways we can pa up these 3 people. Input : 6 Output : 76Approach to Find the SolutionIn this approach, we are going to use the formula of Young ... Read More
There are several challenges of link mining which are as follows −Logical versus statistical dependencies − Two types of dependencies reside in the graph link structures (representing the logical relationship between objects) and probabilistic dependencies (representing statistical relationships, such as the correlation between attributes of objects where, generally, such objects are logically related).The coherent handling of these dependencies is also a challenge for multi-relational data mining, where the data to be mined exist in multiple tables. It should search over the several possible logical relationships between objects, furthermore the standard search over probabilistic dependencies among attributes. This takes a huge ... Read More
There are several tasks of link mining which are as follows −Link-based object classification − In traditional classification approaches, objects are classified depending on the attributes that define them. Link-based classification predicts the category of an object depends not only on its attributes, but also on its links, and the attributes of linked objects.Web page classification is a well-identified instance of link-based classification. It predicts the classification of a web page based on word appearance (words that appear on the page) and anchor text (the hyperlink words, that is, the words it can click on when it can click on ... Read More
A social network is a heterogeneous and multi-relational information set described by a graph. The graph is generally very large, with nodes corresponding to objects and edges corresponding to connections describing relationships or connections between objects. Both nodes and connections have attributes. Objects can have class labels. Links can be one-directional and are not needed to be binary.A social network is a heterogeneous and multi-relational information set described by a graph. The graph is generally very large, with nodes corresponding to objects and edges corresponding to connections describing relationships or connections between objects. Both nodes and connections have attributes. Objects ... Read More
The discovery of frequent substructures usually consists of two steps. In the first step, it can make frequent substructure candidates. The frequency of every candidate is tested in the second step. Most studies on frequent substructure discovery focus on the optimization of the first step because the second step involves a subgraph isomorphism test whose computational complexity is excessively high (i.e., NP-complete).There are various methods for frequent substructure mining which are as follows −Apriori-based Approach − Apriori-based frequent substructure mining algorithms send the same features with Apriori-based frequent itemset mining algorithms. The search for frequent graphs begins with graphs of ... Read More
Periodicity analysis is the mining of periodic patterns, namely, the search for recurring patterns in time-related series data. Periodicity analysis can be used in several important areas. For example, seasons, tides, planet trajectories, daily power consumptions, daily traffic patterns, and weekly TV programs all present certain periodic patterns.Periodicity analysis is implemented over time-series data, which includes sequences of values or events generally measured at equal time intervals (e.g., hourly, daily, weekly). It can also be applied to other time-related sequence data where the value or event may occur at a non-equal time interval or at any time (e.g., online transactions). ... Read More
A time-series database includes sequences of values or events accessed over the repeated assessment of time. The values are generally calculated at equal time intervals (e.g., hourly, daily, weekly). Time-series databases are popular in many applications, such as stock market analysis, economic and sales forecasting, budgetary analysis, utility studies, inventory studies, yield projections, workload projections, process and quality control, observation of natural phenomena (including atmosphere, temperature, wind, and earthquake), numerical and engineering experiments, and medical treatments.A time-series database is also a sequence database. A sequence database is any database that includes sequences of ordered events, with or without a concrete ... Read More
To solve a problem in which we are given an array containing the size of the boxes. Now we are given a condition that we can fit a smaller box inside a bigger box if the bigger box is at least twice the size of the smaller box. Now we must determine how many visible boxes there are, for example.Input : arr[] = { 1, 3, 4, 5 } Output : 3 Put a box of size 1 in the box of size 3. Input : arr[] = { 4, 2, 1, 8 } Output : 1Approach to Find ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP