Where now stands that small knot of villages known as the
Endians, a mighty forest once stood. Indeed, legand has it
that you could have stoodon the edge of the wood and seen
it stretch out for miles, were it not for the trees getting
in the way.
In one section of the forest, the trees stood in a row and
were of hight from 1 to n, each hight occurring once and
once only.
A tree was only visible if there were no higher trees
before it in the row.
For example, if the heights were 324165, the only visible
trees would have been those of height 3,4 & 6.
Write a Program that takes an array of integers
representing the heights of the trees in the row as input
and prints the list of the visible trees.
Answer Posted / harshal
ANSWER
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
develop a program to calculate and print body mass index for 200 employees
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
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.)
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
i don't know about working of nested for loop can any one help me
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
Code for Easily Using Hash Table?
write a program to perform generic sort in arrays?
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
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.
How can I Draw an ellipse in 3d space and color it by using graph3d?