Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
3 16068Where 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.
2 9238An array of size 5X5 is given to us. The elements from 1 to 25 are to be inserted in the array, such that starting from a particular position for an element i, the next element i+1can be inserted only at the mentioned positions (u,v), and if these all positions are occupied then it returns giving a count of how many positions have been occupied in the array: (u,v) = (x+/-3 , y) (u,v) = (x , y+/-3) (u,v) = (x+/-2 , y+/-2). Example: if the starting element is 1 with the given positions (1,2), then next element 2 can be placed at any one of the positions marked with *. _ _ _ _ _ 1 _ _ _ * _ _ _ _ _ _ _ * _ _ * _ _ _ _
6870Definition 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.
4972Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
2519Seat Reservation prog for the theatre. Write a function for seat allocation for the movie tickets. Total no of seats available are 200. 20 in each row. Each row is referred by the Character, "A" for the first row and 'J' for the last. And each seat in a row is represented by the no. 1-20. So seat in diffrent rows would be represented as A1,A2....;B1,B2.....;........J1,J2... Each cell in the table represent either 0 or 1. 0 rep would seat is available , 1 would represent seat is reserved. Booking should start from the last row (J) to the first row(A). At the max 20 seats can be booked at a time. if seats are available, then print all the seat nos like "B2" i.e (2 row, 3 col) otherwise Print "Seats are not available." and we must book consecutive seats only.
1 15811. Remove all the blank spaces between character.Matrix is of 10* 10. eg: INPUT ------------------------------------ | N | A | | V | |T ------------------------------------- | |G | U | |P | -------------------------------------- |T | | | A | | ------------------------------------ OUTPUT: ------------------------------------ | N | A | V | T | | ------------------------------------- |G |U | P | | | -------------------------------------- |T | A | | | | ------------------------------------
2 10481Perform the functionality of 2-D array through 1-D array and in it the functions to be performed were: (1) Display the array in 2-D format (2) Display a particular element (3) Display a particular row (4) Display a particular column
1 5766Post New Nagarro C++ Code Interview Questions
How to create roll-up summary field on lookup relation?
What is the other name of isoantigen?
What is default exception handling in java?
i want to increase my ups back time ,i have added one 12v 68ah battery to my ups but it is not working ,is it possible to make adjustment so that new battery will work.
Java is Pass by Value or Pass by Reference?
Why java uses the concept of the string literal?
Tell me about inheritance in prpc?
Explain thread.sleep?
How can I set the header and footer in the main window?
What are the objectives of quality system.
what is difference between cpp electrical system and refinery electrical system
What is variable in c#?
6. Case Study:- A Failure to Communicate Could you come to my office for a minute, Bob?’ Asked Terry ( the plant manager ). Sure, be right there,” said Bob Gemson. Bob was the plant’s quality control director. He had been with the company for four years. After completing his degree in mechanical engineering, he worked as a production supervisor and then as maintenance manger prior to promotion to his present job. Bob thought he knew what the call was about. “But letter of resignation catches me by surprise,’ began Terry. “1 know that Wilson products will be getting a good man, but we sure need you here, too”. “J thought about it a lot, ‘said Bob, “but there just doesn’t seem to be a future for me here. “ “Why do you say that’?” asked Terry. “Well,” replied Bob, “the next position above mine is yours. With you only thirty- nine,. I don’t think it’s likely that you’ll be leaving soon. “The fact is that I am leaving soon,’ said Terry. “That’s why it’s even more of a shock to know that you are resigning. I think I’ll be moving to the corporate offices in .Tune of next year. Besides, the company has several plants that are larger than this one. We need good people in those plants from time to time, both in quality control and in general management.” “Well, I heard about an opening in the Cincinnati plant last year,” said Bob, “but by the time I checked, the job had already been filled. We never know about job opportunities in the other plants until we read about them in the company paper ‘All this is beside the point now. What would it take to get you to change your mind?” asked Terry. “I don’t think I can change my mind now,” replied Bob. “I’ve already signed a contract with Wilson.’ Questions (a) Evaluate the communication system at this company. (b) What actions might have prevented Bob’s resignation?
How would you create properties in ActiveX Control?
Brief the process of testing with UFT?