My Indian brothers, this is my assignment for collage but I cant seem to understand what they actually want me to do

My Indian brothers, this is my assignment for collage but I cant seem to understand what they actually want me to do.

Read the fucking book, Pajeet

The solution is pretty simple: drop out

traverse the list and return an int representing the number of elements greater than N

gg ez

all wrong

exercise likely means a summation not summatory

I know how to make the summatory of the numbers inside of a list/array, Im just not sure of what they meant by "Recieves a pointer"

then maybe they should word their question better

not my fucking problem

>and allows to get the summatory

not my fault my Pajeet prof can't speak English

I've taken shitty foreign profs to the ombudsman so many times for refusing to accept proper interpretations of their 3rd grade English

Is it just memory maths? You recieve the pointer to the list. You need to figure out the max value of list and then compare that to the input value and write the number of nodes ahead of the specified node number?

the node just tells you the structure of the array. you have to instatiate it to work with the object. the pointer is the reference to that instantiazed object

>The era of 2017
>FUCKING LINKED LISTS
TAKE YOUR PILLS GRANDPA

...

And what if the list contains no elements (i.e. null argument)? What's the "summatory" then?

Come on, it's not like all those uncacheable random memory accesses will cause any troubles.

no one give OP the answer

higher level language fag, go to sleep son

Everyone uses a higher level language

it isn't like linked lists don't exist in high level languages

You know how to add, and have no idea how to use liked lists.

Stay in school.

Im sure the code I must answer with its no longer than 10 lines and yet not a single one of you pajeetfucks can answer it

Inferiors use higher level languages

Oh, now he's projecting. yikes

ever used a stack or a queue? pretty much any decent implementation uses linked lists

0, obviously.

C is a higher-level language you fucking pleb.

So, everyone ITT?

I've got a solution that is 9 lines, but I'm not going to give you the solution to your fucking homework. Cheaters should fail, drop out, and work at McDonalds.

If we're comparing it to fucking assembly it is, dumb fuck

>Cheaters should fail, drop out, and work at McDonalds.
>getting this mad at a pajeet asking for homework help

OP clearly shows no effort to solve the problem for himself and an expectation of others to do it for him

True but namefag is butt blasted

>what is a linked list and how is one made in shitty languages
>what is a pointer

This shit is why we switched to java

To be fair I've never read a book for c++ and Im taking this class with little time as I have. Its my first time seeing a linked list, I've solved all the other problems but this one I cant.

Because OP cannot be bothered to write 9 fucking lines of C.

use recursion you stupid fucking faggot

Recursion is in general not a good choice as you will run out of stack space on large problems.

it's the white devil's secret to poo in the loo. if you can't figure it out, you'll just have to continue using the street like all the other pajeets.

int list_sum_gt(struct node *ptr, int n) {
int sum = 0;
for (; ptr != NULL; ptr = ptr->next)
if (ptr->value > n)
sum += ptr->value;
return sum;
}

You guys are idiots.