Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Company Name Starts with ...
#  A  B  C  D  E   F  G  H  I  J   K  L  M  N  O   P  Q  R  S  T   U  V  W  X  Y  Z

Infosys C++ General Interview Questions
Questions Answers Views Company eMail

1.what is the difference between software & package &application.

1 10721

program to print this triangle * * * * * *

12 18318

Live example for static function?

1 3548

what are prototypes

4 4431

#include void main() { class x { public: int func(int) { cout<<"cool"; return 1; } } }

1 3381





I need to find a specific string between two strings how do I do it?

1 2711

Board Coloring Problem Description In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. Find out the minimum number of colors that should be used to fill the blank spaces in the board, so that the above condition is met. Color representation is -: 0, 1, 2, 3, 4, 5, 6, 7……………………. There is sample board: For Example: Given Board : Matrix representation of board is : [ _ 1 _ _ ] [ 2 _ _ _ ] [ _ _ 2 _ ] [ 2 _ _ _ ] here blank space is represented by '_' . Minimum colors to fill this board (given in the picture)is 4. Instruction to work with Open PBT Client: Specify the work directory path in the 'Work directory Path' field. The path should correspond to your solution Work directory. Download the support files by clicking the Get Dev Files. You will find the problem directories containing: problem.h file problem.c file in your project directory. Code the solution in.c file inside the problem directory All required files will be downloaded to your work directory. Creating additional files is strongly discouraged. Step 1: In your Solution File: Implement your logic in function int color(char board[4][4]) char board[4][4]board is 2 dimensional matrix of order M X M where M = 4. You can create more functions if required, but those functions should be in the same file. Step 2: In your solution keep in mind the following constraints. In this problem you have to write a program that finds the minimum number of colors needed to fill a board in which some of the elements are placed in advance. Function color() will take 2 dimension board as a input. Function color() returns the minimum number of colors that could fill the board meeting the given condition. Board is a 2 dimensional of M X M where M = 4 else return 0 Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. The Prototype of the function is int color(char board[4][4]) This function takes following arguments. board is 2 dimensional matrix of order M X M where M = 4. This function returns minimum no of color by which board can be filled. The constraints are: Board is a 2 dimensional of M X M where M = 4 else return 0 Fill the other elements in the board, such that none of the adjacent elements (vertically, horizontally and diagonally) should be of the same color. Example 1 Input { 2 0 _ 1 } { _ 1 _ _ } { _ 2 _ 0 } { _ _ _ 1 } Output 5 Explanation: We need a minimum 5 different colors to complete the board. Example 2 Input { 2 0 _ 1 3} { _ 1 _ _ 2} { _ 2 _ 0 1} { _ _ _ 1 2} { _ _ _ _ 0} Output 0 Explanation: Size of the board is greater than 4X4. Example 3 Input { _ 0 } { 1 _ } Output 0 Explanation: Size of the board is less than 4X4. For C solutions Header File : boardcoloring.h Function Name : int color(char board1[4][4]) File Name : boardcoloring.c For C++ solutions Header File : boardcoloring.h Class Name : BoardColoring Function Name : int color(char board1[4][4]) File Name : boardcoloring.c

2306

Explain Memory Allocation in C/C++ ?

284

Post New Infosys C++ General Interview Questions




Infosys C++ General Interview Questions


Un-Answered Questions

Explain er diagram?

241


Which is the earliest markup language?

156


Declare a new variable in php equal to the number 3;

206


What do enterprises do for QC 11 to prevent minimum data loss ?

1490


How to test login module with different username and password by using data driven testing in QTP?

260






Define the term "Manufacturer"as introduced in finance act2010.

1258


Let me know that how i calculate the alternator sub tranciant reactance and tranciant reactance.

1696


if you fix salary to some body for Rs.10000/- what are the segregations to be done and what are the deductions to be done (segregations like basic, da,ta,conveyance etc., how ? what percentage what speaks law) and deductions what are those like, pf,esi,pt, etc., what ever

1179


How to notify an object in session when session is invalidated or timed-out?

260


Explain how to use linked server?

264


Why is arraylist not thread safe?

182


what are the three command line utilities and what are their primary functions?

57


What happens to each of the three primary financial statements when you change a) gross margin b) capital expenditures c) any other change?

308


What causes damage to impellers?

1166


Describe the Monocytic cell lines ?

1127