September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
17
Task/Forward-difference/Dart/forward-difference.dart
Normal file
17
Task/Forward-difference/Dart/forward-difference.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
List forwardDifference(List _list) {
|
||||
for (int i = _list.length - 1; i > 0; i--) {
|
||||
_list[i] = _list[i] - _list[i - 1];
|
||||
}
|
||||
|
||||
_list.removeRange(0, 1);
|
||||
return _list;
|
||||
}
|
||||
|
||||
void mainAlgorithms() {
|
||||
List _intList = [90, 47, 58, 29, 22, 32, 55, 5, 55, 73];
|
||||
|
||||
for (int i = _intList.length - 1; i >= 0; i--) {
|
||||
List _list = forwardDifference(_intList);
|
||||
print(_list);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue