I need to write a function that traverses a general list and deletes all nodes that are after a node with a negative key.
But I dont know where to start so can I get some help

yellowSnow commented: Stop acting like a twat! +0

Recommended Answers

All 13 Replies

Well, showing something of what you know about linked lists would be a start.
Then we have something to work with.

With no effort on your part, our choices are
- ignore you
- do your homework for you.
Neither are beneficial to you.

Well, showing something of what you know about linked lists would be a start.
Then we have something to work with.

With no effort on your part, our choices are
- ignore you
- do your homework for you.
Neither are beneficial to you.

I know im asking you to do stuff for me because I have no clue how to do it. Please help me. I have no help.
I dont ask for help if I know the answer.
Im pretty bad at C programming so little help would be appreciated

Wow, that was easier than I thought - thanks for marking the thread solved.

i clicked it on accident. So im guessing you wont help me because youre an A hole.

's all right, I've no interested in helping the clueless who resort to insults before showing some effort.

i clicked it on accident. So im guessing you wont help me because youre an A hole.

I think your technique on asking for help could use a little work.

commented: Dunno, early identification of idiots is kinda useful ;) +36

I think your technique on asking for help could use a little work.

Im gettin frustrated on this problem can you help me?

How about you guys help me with a small question?
how do i draw a pic of file with the file marker to explain an answer??

How about you guys help me with a small question?
how do i draw a pic of file with the file marker to explain an answer??

That dosen't even make sence.
By pic, I guess you mean picture. Not sure what you mean by "picture of a file," that could be almost anything. Not sure what "the file marker" is. Finally, What does a picture of a file drawn with "the file marker" have to do with explaining an answer. Explaining an answer to what? Filesystems?
Lastly, what does this have to do with programming in C?

I need to write a function that traverses a general list and deletes all nodes that are after a node with a negative key.
But I dont know where to start so can I get some help

1. Make a simple linked list by adding several nodes to it.
2. Traverse it using either in,pre or postorder using recursion.
3. Delete the nodes.

I assume that you know how to traverse a linked list.
just strat from 0th node and go to the node which containg negative number.
make next node of this current node(which containg negative number) as NULL node or list end indicating character. then it is done.
free the space used by that 'to be deleted' nodes using appropriate function which is used to free the memory.

@9868, kimaeasha and abhi.navale

Why are you even attempting (and I use that term loosely) to help out yasaswyg? This poster, who is new to these forums (like me) has the audacity to call an extremely astute and knowledgeable poster (Salem) names and still expect assistance.

This is my take on the matter - unless the OP has the common courtesy to post again and issue an apology to Salem, then I say screw him (or her).

I mean take a look at the title of the post - "help, please, ASAP, I'm lazy, I don't have a clue, I can't be buggered even formulating a half decent topic heading for the post". And then they expect help.

Sheesh!

commented: I couldn't have said it better :) +20

That dosen't even make sence.
By pic, I guess you mean picture. Not sure what you mean by "picture of a file," that could be almost anything. Not sure what "the file marker" is. Finally, What does a picture of a file drawn with "the file marker" have to do with explaining an answer. Explaining an answer to what? Filesystems?
Lastly, what does this have to do with programming in C?

It was one of my questions in my hw and I didnt know how to answer it
The question was "What would be printed from the following program? Draw a picture of the result with the file marker to explain your answer"
I didnt know how to answer that question

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.