Monday, 23 February 2015

People the event "NIGHT BUSTERS" is started.It is an overnight programming challenge. All you need to know about "NIGHT BUSTERS" is that you will be given seven coding questions. You can code in any language you want to and try as many questions as you can. You need to submit your answers on the mail id below before 24th 11:30 p.m. :
utkarsh.mits11@gmail.com
After the given time no entries will be entertained. So hurry up!!!For further details contact:


Mahima Mehta 9413527858
Anushree Kulshrestha 9587078854
Vishraja Shrivastava 8829030099


The questions for the event are:

Q1.  Write a program to print the pattern  

              4 3 2 1 2 3 4
             3 3 2 1 2 3 3
             2 2 2 1 2 2 2
             1 1 1 1 1 1 1
              2 2 2 1 2 2 2
              3 3 2 1 2 3 3
              4 3 2 1 2 3 4

Q2. Write a program to separate the numbers and characters in a string and then arrange in the order of numbers and charcters occurring alternatively.

Q3. 

                 
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Zlt926b-tzb3VQDHU5WFz0gfvQz9x9v8-hMffPMNn6HVrqjO4K1hRns0XfmtdC3qnCf-WzE8VC2cZ_sAFvNZnleyyDPVruFg_ZF-0yEeeMcsn-DkDagRQvazSq5jZZLOz4SQ6srpbP4/s1600/Untitled.png
                         

 In this problem you are to write a program to explore the above array for a treasure. The values in the array are clues. Each cell contains an integer between 11 and 55; for each value the ten's digit represents the row number and the unit's digit represents the column number of the cell containing the next clue. Starting in the upper left corner (at 1, 1), use the clues to guide your search of the array. (The first three clues are 11, 34, and 42). The treasure is a cell whose value is the same as its coordinates. Your program must first read in the treasure map data into a 5 by 5 array. Your program should output the cells it visits during its search, and a message indicating where you found the treasure.


Q4. 1. Consider the sequence of digits from 1 through N (N<=9) in increasing order: 1 2 3 4 … N Insert either a ‘+’ (for addition) or a ‘-‘ (for subtraction) between each of the digits so that the resultant sum is zero. Print all possible combinations that sum to zero for a number 7. Example: Enter a number: 7 and print all the possible combinations.


Q5. Write a program to search for the "saddle points" in a 5 by 5 array of integers. A saddle point is a cell whose value is greater than or equal to any in its row, and less than or equal to any in its column. There may be more than one saddle point in the array. Print out the coordinates of any saddle points your program finds. Print out "No saddle points" if there are none.


Q6. WAP to generate the first n elements of the Stöhr defined as follows: S[0] = 1 S[n] is the smallest number that cannot be expressed as the sum of two distinct previous elements in the sequence. Thus the sequence begins with 1, 2, 4, 7, and 10. The next element is 13, because 11 (=1+10) and 12 (=2+10) are sums of previous elements, but 13 is not.


Q7. Write a program to check if a given tree is balanced or not? If not than balance it.


No comments:

Post a Comment