Click here to Skip to main content
15,881,588 members
Home / Discussions / C#
   

C#

 
GeneralRe: Execute keyboard shortcuts through code Pin
Member 108502536-Aug-15 1:40
Member 108502536-Aug-15 1:40 
GeneralRe: Execute keyboard shortcuts through code Pin
OriginalGriff6-Aug-15 1:43
mveOriginalGriff6-Aug-15 1:43 
GeneralRe: Execute keyboard shortcuts through code Pin
Member 108502536-Aug-15 1:48
Member 108502536-Aug-15 1:48 
GeneralRe: Execute keyboard shortcuts through code Pin
Member 108502536-Aug-15 1:59
Member 108502536-Aug-15 1:59 
GeneralRe: Execute keyboard shortcuts through code Pin
OriginalGriff6-Aug-15 2:11
mveOriginalGriff6-Aug-15 2:11 
GeneralRe: Execute keyboard shortcuts through code Pin
Member 108502536-Aug-15 7:37
Member 108502536-Aug-15 7:37 
GeneralRe: Execute keyboard shortcuts through code Pin
OriginalGriff6-Aug-15 7:59
mveOriginalGriff6-Aug-15 7:59 
QuestionInterview question - adding using A RecursiveAlgorithm Pin
anthonyjames5-Aug-15 12:18
anthonyjames5-Aug-15 12:18 
Hi All,

Below is an interview question about using recursion to add two arrays.

I can't figure it out though because it does not seem to allow any kind of index to keep track of where you are, I have been down a few roads - trying to test for null / default values in the array but because it is a byte[] type nothing worked.

Any help would be great thanks - this is not a homework question.

C#
public AddResult UsingARecursiveAlgorithm_ValuesAreAdded(byte[] a, byte[] b)
{
var result = AddRecursive(a, b);

// Assert

return new AddResult(a, b, result);

}


E.G.

Input : { 1, 1, 1 }, { 1, 1, 1 }

Result: {2,2,2}

Input : { 1, 1, 255 }, {0, 0, 1 }

Result: {1,2,0}

Conditions:

a & b are never null, and are always of the same length.

The algorithm should be non destructive to the inputs.

modified 5-Aug-15 19:12pm.

GeneralRe: Interview question - adding using A RecursiveAlgorithm Pin
PIEBALDconsult5-Aug-15 13:15
mvePIEBALDconsult5-Aug-15 13:15 
GeneralRe: Interview question - adding using A RecursiveAlgorithm Pin
anthonyjames5-Aug-15 13:35
anthonyjames5-Aug-15 13:35 
AnswerRe: Interview question - adding using A RecursiveAlgorithm Pin
Dave Kreskowiak5-Aug-15 13:37
mveDave Kreskowiak5-Aug-15 13:37 
GeneralRe: Interview question - adding using A RecursiveAlgorithm Pin
anthonyjames5-Aug-15 13:43
anthonyjames5-Aug-15 13:43 
GeneralRe: Interview question - adding using A RecursiveAlgorithm Pin
Dave Kreskowiak5-Aug-15 13:56
mveDave Kreskowiak5-Aug-15 13:56 
QuestionIm curious of answers Pin
Jesse Glover5-Aug-15 9:30
Jesse Glover5-Aug-15 9:30 
AnswerRe: Im curious of answers Pin
Ravi Bhavnani5-Aug-15 9:41
professionalRavi Bhavnani5-Aug-15 9:41 
GeneralRe: Im curious of answers Pin
Jesse Glover5-Aug-15 9:43
Jesse Glover5-Aug-15 9:43 
GeneralRe: Im curious of answers Pin
Ravi Bhavnani5-Aug-15 9:49
professionalRavi Bhavnani5-Aug-15 9:49 
GeneralRe: Im curious of answers Pin
Jesse Glover5-Aug-15 10:31
Jesse Glover5-Aug-15 10:31 
AnswerRe: Im curious of answers Pin
Mycroft Holmes5-Aug-15 14:26
professionalMycroft Holmes5-Aug-15 14:26 
GeneralRe: Im curious of answers Pin
Jesse Glover5-Aug-15 14:29
Jesse Glover5-Aug-15 14:29 
GeneralRe: Im curious of answers Pin
Mycroft Holmes5-Aug-15 14:47
professionalMycroft Holmes5-Aug-15 14:47 
GeneralRe: Im curious of answers Pin
pkfox6-Aug-15 20:34
professionalpkfox6-Aug-15 20:34 
QuestionGet a partial string reading PORT via rs232 Pin
goldsoft5-Aug-15 8:49
goldsoft5-Aug-15 8:49 
AnswerRe: Get a partial string reading PORT via rs232 Pin
PIEBALDconsult5-Aug-15 9:41
mvePIEBALDconsult5-Aug-15 9:41 
AnswerRe: Get a partial string reading PORT via rs232 Pin
Ravi Bhavnani5-Aug-15 9:47
professionalRavi Bhavnani5-Aug-15 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.