
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 7197 Articles for C++

161 Views
We had to explore the tree and assess the weight of each hub in order to identify the nodes in a particular tree whose weighted string may be a palindrome. In this scenario, a hub's weight is seen as a string. The weight string is checked to see if it is a palindrome using the palindrome checking theory. We traverse the tree recursively, starting at the root, and evaluate the weight of each node. We raise the counter if the weight string is a palindrome. We can accurately examine the hubs that satisfy the requirement of having a weighted string ... Read More

127 Views
The assignment is to check the number of hubs in a given tree where the weight of each hub is detachable by a given number, X. To achieve this, we navigate the tree in a precise way, analysing each hub and its weight. In case the weight of a hub is distinct by X, we increase a counter. We proceed with this process for all hubs within the tree. Finally, the value of the counter speaks to the overall number of hubs within the tree, whose weight may be a figure of X. This approach guarantees that we recognise and ... Read More

114 Views
To check the nodes of a tree whose weighted string is a rearranged word of the given string, perform a depth-first search (DFS) on the tree. Beginning from the root, navigate each hub and calculate the weighted string by relegating a weight to each character within the node's esteem. Compare this weighted string with the given string to check for a rearranged word coordinate. In the event that they are rearranged words, increase the check. Recursively investigate the children of each node. At last, return the overall count of hubs fulfilling the condition. This approach guarantees each hub within the ... Read More

103 Views
To identify the hubs of a tree in preparation for a depth-first look (DFS) traversal and whose weighted string does not include any copy characters. We travel through each hub, starting at the root hub, keeping track of the characters we've already encountered in the weighted string. We stop providing navigational support down that path if we run upon a character who is already present in the collection. For each hub we pass throughout the traverse, we raise a check variable. The count variable will indicate the number of hubs in the tree whose weighted string does not include any ... Read More

68 Views
To check in the event that it is conceivable to dole out values such that all the given relations are fulfilled, we have to analyse the relations and decide on the off chance that they can be satisfied at the same time. This will be drawn closer by utilising limitation fulfilment methods. We look at each connection and its corresponding values. By methodically assessing the imperatives and endeavouring to dole out values that fulfil them, ready to decide in the event that a substantial task exists. In the event that we experience clashing limitations amid the method, showing an incomprehensible ... Read More

281 Views
The assignment is to recreate the initial cluster from a set of given sub-sequences. This includes finding the order in which the components showed up within the unique cluster based on the given subsequences. By analysing the designs and connections between the components within the subsequences, the calculation decides the right arrangement of the components and recreates the first cluster. The remade cluster speaks to the introductory grouping from which the subsequences were inferred. This preparation permits us to recuperate the first cluster structure and data, empowering the investigation or control of the information. Methods Used DFS Topological sorting ... Read More

477 Views
Problem Statement We have given a string str containing the numeric and alphabetical characters. We need to find the sum of all numbers represented by a continuous sequence of digits available in the given string. Sample Examples Input str = “12were43” Output 55 Explanation The sum of 12 and 43 is equal to 55. Input str = “1a2c3d” Output 6 Explanation The sum of 1, 2, and 3 is 6. Input str = “werderfrewsf” Output 0 Explanation It gives 0 in the output as the string contains no digit. Our logic to solve the ... Read More

180 Views
Problem Statement We have given a string str containing a total of N words. We need to find all palindrome words in the given string and create a new string by reversing the order of all palindrome words. Sample Examples Input str = ‘nayan was gone to navjivan eye hospital’ Output ‘eye was gone to navjivan nayan hospital’ Explanation The string contains three palindrome words: nayan, navjivan, and eye. We have reversed the order of all three words and kept all other words the same. Input ‘Hello, users! How are you?’ Output ‘Hello, users! How are you?’ ... Read More

340 Views
Problem Statement We have given binary string str, and we require to remove minimum characters from the string such that we can place all zeros before 1. Sample Examples Input str = ‘00110100111’ Output 3 Explanation Here, we can achieve output 3 in two ways. We can either remove arr[2], arr[3], and arr[5] or arr[4], arr[6], and arr[7] from the string. Input str = ‘001101011’ Output 2 Explanation We can remove arr[4] and arr[6] to place all zeros before 1. Input str = ‘000111’ Output 0 Explanation In the given str, all ... Read More

132 Views
Problem Statement We have given an array of length ‘N’ containing some positive integers. Also, we have given the string of length ‘N-1’ containing only ‘*’ and ‘+’ characters, where ‘*’ is a multiplication operator, and ‘+’ is an addition operator. We require to perform the arithmetic operation with array elements in such a way that we can get a minimum positive integer value. Sample Examples Input array = [1, 2, 3], str = “*+” Output 5 Explanation It is the resultant value of ((1*2) + 3). Input array = [3, 3, 3, 3], str = ‘*++’ ... Read More