Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include "scl_functions.h"
- float SCL_sum(TipoNodoSCL* head_ptr){
- if (head_ptr!=NULL)
- return SCL_sum(head_ptr->next)+head_ptr->value;
- else
- return 0;
- }
- void SCL_integral_aux(TipoNodoSCL* head_ptr, float sum_till_now) {
- int temp=head_ptr->value;
- head_ptr->value=sum_till_now;
- sum_till_now+=temp;
- if (head_ptr->next!=NULL)
- SCL_integral_aux(head_ptr->next,sum_till_now);
- }
- void SCL_integral(TipoNodoSCL* head_ptr){
- SCL_integral_aux(head_ptr->next,head_ptr->value);
- }
- float SCL_dot(TipoNodoSCL* head1_ptr, TipoNodoSCL* head2_ptr) {
- if (head1_ptr!=NULL&&head2_ptr)
- return SCL_dot(head1_ptr->next,head2_ptr->next)+head1_ptr->value*head2_ptr->value;
- else
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment