i***0 发帖数: 8469 | 1 CODING QUESTIONS
Please write a solution for each of the following coding questions:
1. Given a singly linked list of integers, write a function to remove all
nodes with even values, and then provide a set of test cases against that
function.
2. Write me a function that receives three integer inputs for the lengths
of the sides of a triangle and returns one of four values to determine the
triangle type (1=scalene, 2=isosceles, 3=equilateral, 4=error). Generate
test cases for the functi | S**I 发帖数: 15689 | 2 都很简单么
all
lengths
the
a
【在 i***0 的大作中提到】 : CODING QUESTIONS : Please write a solution for each of the following coding questions: : 1. Given a singly linked list of integers, write a function to remove all : nodes with even values, and then provide a set of test cases against that : function. : 2. Write me a function that receives three integer inputs for the lengths : of the sides of a triangle and returns one of four values to determine the : triangle type (1=scalene, 2=isosceles, 3=equilateral, 4=error). Generate : test cases for the functi
| A*******e 发帖数: 108 | 3 for 2:
int triangle (float a, float b, float c)
{
if (a+b<=c || a+c<=b || b+c<=a)
return 4;
if (a==b && b==c)
return 3;
if (a==b || b==c || a==c)
return 2;
return 1;
}
all
lengths
the
a
【在 i***0 的大作中提到】 : CODING QUESTIONS : Please write a solution for each of the following coding questions: : 1. Given a singly linked list of integers, write a function to remove all : nodes with even values, and then provide a set of test cases against that : function. : 2. Write me a function that receives three integer inputs for the lengths : of the sides of a triangle and returns one of four values to determine the : triangle type (1=scalene, 2=isosceles, 3=equilateral, 4=error). Generate : test cases for the functi
|
|