Write an algorithm that receives a string and reverses it.
Answers were Sorted based on User's Feedback
Answer / sreejesh1987
step 1:Declare the variables needed.
step 2: Get the String in a String variable
step 2:Use a for loop to reverse the string.
step 3:Display the elements of the string from last element
to first element.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sudip chatterjee
1. Start.
2. Declare Array str1[25], str2[25] as an alphanumeric.
3. Declare i, g, l, as numeric.
4. Assign or accept value to Str1.
5. l=i=0;
6. while(str1[i]!="/0")["/0"last index point that u entered.]
a.increase i, l by 1;
7. Repeat steps i,ii, iii for j from o
i. str2[j]= str1[i-1]
ii. increase j by 1.
iii. decrease i by 1.
8. str2[j]="/0" .
9. Display str2
10. Exit.
| Is This Answer Correct ? | 2 Yes | 0 No |
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
0 Answers Jomo Kenyatta University,
Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.
Write a simple encryption program using string function which apply the substitution method.
write a function -oriented program that generates the Fibonacci, the current numbers of n(as input) and display them (series). In Fibonacci, the current third number is the sum of the previous number.
Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.
0 Answers Nagarro, Wollega University,
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
i don't know about working of nested for loop can any one help me
write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000
Complexity T(n) What is the time complexity T(n) of the following portions of code? For simplicity, you may assume that n is a power of 2. That is, n = 2k for some positive integer k. a) ? for (i = 1; i <= n; i++) { j = n; cout << i << ? ? j << ? ? << endl; } b) ? for (i = 0; i <= n; i += 2) { j = n; cout << i << ? ? j << ? ? << endl; } c) ? for (i = n; i >= 1; i = i/2) { j = n; cout << i << ? ? j << ? ? << endl; } d) for (i = 1; i <= n; i++) { j = n; while (j >= 0) { cout << i << ? ? j << ? ? << endl; j = j - 2; } }
what is virtual constroctor ? give an exam for it?-(parimal dhimmar)
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)