Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

The following pseudocode describes how to swap two letters in a word. We are given a string str and two positions i and j. (i comes before j) Set first to the substring from the start of the string to the last position before i. Set middle to the substring from positions i + 1 to j - 1. Set last to the substring from position j + 1 to the end of the string. Concatenate the following five strings: first, the string containing just the character at position j, middle, the string containing just the character at position i, and last. Check this pseudocode, using the string "Gateway" and positions 2 and 4. Draw a diagram of the string that is being computed,


design a c++ program with using and without using virtual function getdata() and putdata() to read and display the details of student such as sname,sregno and address?

Write a program that reads lines of text and appends them to a char buffer[1000]. Stop after reading 1,000 characters. As you read in the text, replace all newline characters '\n' with '\0' terminators. Establish an array char* lines[100], so that the pointers in that array point to the beginnings of the lines in the text. Consider only 100 input lines if the input has more lines. Then display the lines in reverse order, starting with the last input line. 


You have given an array A containing N integers. You can do the following operation at most K times:


•  Choose any index i and increase the value of At by 1.

Your task is to find the maximum bitwise OR of the array.

Input format

•  The first line contains an integer T denoting the number of test cases.

•  The first line of each test case contains two space-separated integers N and K.

•  The second line of each test case contains N space-separated integers denoting array A.


Output format


For each test case, print the maximum possible bitwise OR of the array after performing at most K operations in a new line.


Constraints


1 T 100000 1 N 200000

O K le18

O Ai 260


It is guaranteed that the sum of N over T test cases does not exceed le6.


Explanation


For the first test case, we can increase the value of the 5-th index by 2. Thus the A becomes {1, 3, 7, 0, 8, 1}. The bitwise OR of array A becomes 15.


Population limit: 20792

Note: Population limit will change at random intervals. So please make sure answer is computed for the correct population limit before submitting.

Write a program that accepts five numbers from the user and displays the values from lowest to highest. Assume that there are no duplicate values.

String processing


You are given a dictionary that maps all lowercase English alphabets from

'a' to 'z' to either lor -1.


For a string of length k, you perform the below operation:

•      Find the maximum character from index Ito k, and find the dictionary mapping of the respective maximum character.

•      If dictionary mapping is 1, increment all characters from Ito k.

•      'a' becomes 'b', 'b' becomes 'c', .      'z' becomes 'a'.



Task

Determine the count of each lowercase English alphabet after N operations.


For Full Instructions and Note Please Use Those Images as reference... Please help


https://drive.google.com/file/d/1QVE-utPuKxxxah3P5T5geL93MX1G5vy_/view?usp=sharing

https://drive.google.com/file/d/1b3RT2IBIBMG2Ojob6uGqoDglXHg-Z928/view?usp=sharing





C++ program that will initialize an array variable with your names and the print out the names


What is the output of this program (if any)


#include<iostream.h>


using namespace std; 


void main() 

{

int num=123;

int *p_num;

cout<<"if any"<<"\n";

cout<<num<<"\n";

cout<<&num<<"\n";

cout<<*p_num<<"\n";

cout<<p_num<<"\n";

}


Write a C++ program that outputs the following elements in the diagram using Queue data structure

LATEST TUTORIALS
APPROVED BY CLIENTS