C++ Queries to Count Ones and Zeros to the Left of Given Index

Prateek Jangid
Updated on 26-Nov-2021 05:50:59

273 Views

Discuss a problem to answer queries to the given array. For each query index, we need to find the number of ones and zeros to the left of the index, for example.Input: arr[ ] = { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0}, queries[ ] = { 2, 4, 1, 0, 5 } Output: query 1: zeros = 1, ones = 1 query 2: zeros = 1, ones = 3 query 3: zeros = 1, ones = 0 query 4: zeros = 0, ones = 0 query 5: zeros = 2, ones = 3 Input: arr[ ... Read More

C++ Queries on XOR of XORS of All Subarrays

Prateek Jangid
Updated on 26-Nov-2021 05:48:39

283 Views

To calculate the XOR of all the subarrays present in the given range and print it. For exampleInput : arr[] = { 4, 1, 2, 3, 5 }, Q = 3 Queries q1 = { 1, 2 } q2 = { 2, 4 } q3 = { 1, 4 } Output : 0 2 0 Explanation : As the given problem states that we need to find XOR of all the subarrays present in the given range so as for query 2 the subarrays are : {1}, {2}, {3}, {1, 2}, {2, 3}, (1, 2, 3} So ... Read More

C++ Queries on XOR of Greatest Odd Divisor of the Range

Prateek Jangid
Updated on 26-Nov-2021 05:41:33

240 Views

Given an array of N integers and Q queries of ranges. For each query, we need to return the XOR of the greatest odd divisor of each number in the range.The greatest odd divisor is the greatest odd number which can divide number N, e.g . The greatest odd divisor of 6 is 3, for example.Input: nums[ ] = { 3, 6, 7, 10 }, query[ ] = { { 0, 2 }, { 1, 3 } } Output: query1: 7 query2: 1 Explanation: greatest odd divisors of nums array are { 3, 3, 7, 5 }. For query ... Read More

Test Plan Template Sample Document with Web Application Example

Vineet Nanda
Updated on 26-Nov-2021 05:27:07

5K+ Views

A Test Plan is a thorough document that outlines the test strategy, objectives, timetable, estimation, deliverables, and resources needed to accomplish software testing. The Test Plan assists us in determining the amount of work required to confirm the quality of the application being tested. The test plan is a blueprint for conducting software testing operations as a defined procedure, which the test manager closely monitors and controls."A test plan is a document detailing the scope, strategy, resources, and timetable of expected test activities, " according to the ISTQB definition.Let's look at an example/scenario of a Test Plan: You want to ... Read More

Test Environment for Software Testing

Vineet Nanda
Updated on 26-Nov-2021 05:16:45

2K+ Views

What is the definition of a test environment?A testing environment is a software and hardware configuration that allows testing teams to run test cases. In other words, it enables test execution with properly configured hardware, software, and network.The test bed or test environment is set up according to the requirements of the Application Under Test. On rare occasions, a test bed may be a mix of the test environment and the test data with which it interacts.Software testing success is ensured by setting up the correct test environment. Any errors in this procedure may result in the customer incurring more ... Read More

Test Condition vs Test Scenario: What's the Difference

Vineet Nanda
Updated on 26-Nov-2021 05:10:13

5K+ Views

What exactly is a Test Condition?In software testing, a test condition is a specification that a tester must adhere to when testing a software program. For test cases, a test condition is a collection of restrictions that might include features such as transactions, functions, or structural aspects in order to test the software application. Test circumstances aid in the bug-free development of software applications.Test conditions are developed from real-world test situations, as well as test bases and use cases. There might be several Test Conditions in a Test Scenario while verifying Test Conditions.Test Condition's level of detail is determined by ... Read More

SDLC vs STLC: What’s the Difference

Vineet Nanda
Updated on 26-Nov-2021 05:07:52

2K+ Views

The Software Development Life Cycle (SDLC) and the Software Testing Life Cycle (STLC), despite their similar names, are two different and distinct methods for guaranteeing project success in software development. Let's look at how you may get the most of both of them for your software development project −What is Software Development Life Cycle?The Software Development Life Cycle (SDLC) is a term that refers to the process of creating software.Based on a research paper by Dr. Winston Royce released in 1970, the Software Development Life Cycle (SDLC) is a linear sequence of processes for delivering software. The procedure is as ... Read More

Principles of Information System Security

Vineet Nanda
Updated on 26-Nov-2021 05:05:08

3K+ Views

What is the definition of information security (InfoSec)?The methods and practices that businesses employ to secure information are referred to as information security (or InfoSec). This also contains policy settings that prohibit unauthorized individuals from gaining access to company or personal data. InfoSec is a rapidly expanding and changing discipline that encompasses everything from network and infrastructure security to testing and auditing.Information security safeguards sensitive data against illegal access, alteration, or recording, as well as any disturbance or destruction. The purpose is to protect vital data such as customer account information, financial information, and intellectual property.Robbery of private information, data ... Read More

Find Unique Permutations Starting with 1 of a Binary String Using C++

Prateek Jangid
Updated on 25-Nov-2021 13:26:02

482 Views

In the given problem, we are given a string consisting of 0’s and 1’s; we are required to find the total number of permutations such that the string starts with 1’s. As the answer can be a vast number, so we print as a mod with 1000000007.Input : str ="10101001001" Output : 210 Input : str ="101110011" Output : 56We will solve the given problem by applying some combinatorics and building up some formulas to solve this problem.Approach to find The SolutionIn the approach, we will calculate the number of 0's and 1's. Now let's suppose n is the ... Read More

Find Number of Unique Pairs in an Array Using C++

Prateek Jangid
Updated on 25-Nov-2021 13:04:53

1K+ Views

We require the appropriate knowledge to create several unique pairs in an array syntax in C++. In finding the number of unique pairs, we count all unique pairs in a given array, i.e., all possible pairs can be formed where each pair should be unique. For example −Input : array[ ] = { 5, 5, 9 } Output : 4 Explanation : The number of all unique pairs are (5, 5), (5, 9), (9, 5) and (9, 9). Input : array[ ] = { 5, 4, 3, 2, 2 } Output : 16Approach to find The SolutionThere are Two ... Read More

Advertisements