Programming Articles - Page 2145 of 3363

Selenium WebDriver- Revisiting Important Features

Sharon Christine
Updated on 17-Jan-2020 12:47:23

263 Views

It’s been more than a decade since Selenium automation tool is here to automate our testing needs. As a free to use tool with dedicated community, it has lot of features to make our automation testing more reliable and comfortable. Seeing the growing popularity of Selenium webdriver, let’s revisit some of the important features of it, which proves why Selenium webdriver still stand out in the crowd.Key Features – Selenium WebDriverCompatibility with Many Web BrowsersSelenium WebDriver supports wide range of web browsers available in the market such as Firefox, Chrome, Internet Explorer, Opera, Safari and many more. Unless the other ... Read More

Print all possible combinations of r elements in a given array of size n in C++

sudhir sharma
Updated on 17-Jan-2020 11:42:28

2K+ Views

In this problem, we are given an array of size n and a positive integer r. Our task is to print all possible combinations of the elements of the array of size r.Let’s take an example to understand the problem −Input: {5, 6, 7, 8} ; r = 3 Output : {5, 6, 7}, {5, 6, 8}, {5, 7, 8}, {6, 7, 8}To solve this problem an approach would be fixing elements and then recuring or looping over others to find all combinations. In this, we have to fix first n-r+1 elements only and loop or recur over the rest.Example#include ... Read More

Print all possible expressions that evaluate to a target in C++

sudhir sharma
Updated on 17-Jan-2020 11:38:28

341 Views

In this problem, we are given a string of integers from 0 to 9 and a target value. We have to print out ways in which we can generate expression using +, -, and * operation which is evaluated to the value equal to target.Let’s take an example to understand the topic better −Input: string = “123” , target= 6 Output: { “1+2+3”, “1*2*3” }To solve this problem, we will be creating expressions by placing all possible binary operators between digits and then checking the result of the expression with the target value.We will pass all values to a recursive ... Read More

Print all possible paths from top left to bottom right of a mXn matrix in C++

sudhir sharma
Updated on 17-Jan-2020 11:36:41

407 Views

In this problem, we are given an mXn 2D matrix and we have to print all possible paths from top left to the bottom right of the matrix. For traversal, we can move only right and down in the matrix.Let’s take an example to understand the topic better −Input: 1 3 5 2 8 9 Output: 1 -> 3 -> 5 -> 9 1 -> 3 -> 8 -> 9 1 -> 2 -> 8 -> 9To solve this problem, we will move from one cell to another and print the path on going down and right. We will do ... Read More

Print all possible strings of length k that can be formed from a set of n characters in C++

sudhir sharma
Updated on 17-Jan-2020 11:35:01

2K+ Views

In this problem, we are given a set of characters and a positive integer k and we have to print all possible strings of length k that can be generated using the characters of the set.Let’s take an example to understand the problem better −Input: set = {‘x’, ‘y’, ‘z’} , k = 2 Output: xy, xz, yzTo solve this problem, we have to find all possible sequences that can be generated. For the set of size n, the total number of a possible string of length k will be nk (n^k). We will use a recursive call to generate ... Read More

Spring Boot Actuator A Production Grade Feature in Spring Boot

Samual Sam
Updated on 17-Jan-2020 11:38:12

628 Views

Spring Boot Actuator is one of the greatest and most useful feature in Spring Boot framework. Actuator module in spring boot helps application developers to implement the production grade features like metrics, health check, security, etc. with minimal effort.This article will guide you through how to enable the spring boot actuator, configure endpoints and how to modify the default settings in the application.properties file. Note that spring boot actuator can work only for the spring boot application, this can not be integrated to the non-spring boot applications.List of Endpoints SupportedHere is the list of actuator endpoints that is supported at ... Read More

Print all possible strings that can be made by placing spaces in C++

sudhir sharma
Updated on 17-Jan-2020 11:31:08

413 Views

In this problem, we are given a string and we have to print all those string that can be made using this string by placing space in between the characters of the string.Let’s take an example to understand the topic better −Input: string = ‘XYZ’ Output: XYZ, XY Z, X YZ, X Y ZTo solve this problem, we will have to find all the possible ways in which we can put space in the string. For this we will use recursion. In this, we will place spaces on by one and generate a new string.Example Live Demo#include #include using ... Read More

Print all possible sums of consecutive numbers with sum N in C++

sudhir sharma
Updated on 17-Jan-2020 11:30:24

554 Views

In this problem, we are given a positive integer N and we have to print the sequence of all possible consecutive numbers with a sum equal to N.Let’s take an example to understand the problem,Input: N = 15 Output: 1 2 3 4 5 7 8A simple solution to this problem is by adding up consecutive sequence combinations till N/2. And then print the sequence that sums up to N.Example Live Demo#include using namespace std; void printConsequtiveSum(int N){    int start = 1, end = (N+1)/2;    while (start < end){       int sum = 0;       for (int i = start; i

Print all possible words from phone digits in C++

sudhir sharma
Updated on 17-Jan-2020 11:23:51

909 Views

In this problem, we are given a number and we have to print all words that can be formed by pressing those words in an old fashioned mobile keyboard.We are quite familiar with the QWERTY keyboard style that we use today. But before the invention of QWERTY keypad phones were fitted with keypads with 12 buttons and each button contains words and numbers both. Like they word 6 on the keypad will contain words “MNO” which will be typed by clicking one, twice or thrice the keys.The keypad looked like this −12ABC3DEF4GHI5JKL6MNO7PQRS8TUV9WXYZ*0#In these keywords also all words are present and ... Read More

Print all prime factors and their powers in C++

sudhir sharma
Updated on 17-Jan-2020 11:16:29

746 Views

In this problem, we are given a number N, and we have to find all unique prime factors and their powers that divide the number.Let’s take an example to understand the topic −Input: 55 Output: 5 power 1 11 power 1Explanation −55 is divisible by 5 and 11.To solve this problem, an easy approach to solving the problem is to find prime factors of N. And then find power of the prime number that divides the number N and print it.AlgorithmEfficient ApproachStep 1: Find an array s[N+1]. s[i] = prime factor of i dividing N. Step 2: Find all powers ... Read More

Advertisements