Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 868 results for
traversing
- Page 1
traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Hello, I am having some trouble
traversing
backwards through a double linked list. Basically this program pulls …
Traversing Table with merged cells
Programming
Web Development
12 Years Ago
by azareth
… doesn't need any computation and finally this if for
traversing
the table and computation var TableID = getTableID(tableID); function getTableID…
Re: traversing through a link list backward
Programming
Software Development
15 Years Ago
by VernonDozier
…'re creating a ListNode, then deleting it? As far as
traversing
through the list, if you want to be able to…
Re: traversing through a link list backward
Programming
Software Development
15 Years Ago
by JustLearning
…'re creating a ListNode, then deleting it? As far as
traversing
through the list, if you want to be able to…
deleting a node with out traversing the linkedlist
Programming
Software Development
17 Years Ago
by tarakant_sethy
hi i m a new member. i have a question. so plz answer me if any one have the answer. how can i delete a node without
traversing
the linkedlist. let's say want to delete the third node of the linkedlist without
traversing
it. thank u
Re: What am I doing wrong. Traversing lists and getting data.
Programming
Software Development
13 Years Ago
by SacredFootball
… traverse the array? EDIT: [CODE]struct payload *tempPtr ; //pointer for
traversing
[/CODE] should be [CODE]struct memberInfo *tempPtr ; //pointer for…
Excel 2003- Reading Text Files from the EOF traversing up
Hardware and Software
Microsoft Windows
15 Years Ago
by shouvik.d
… read the next two lines (which I already cover while
traversing
up) and extract few information. Can anybody please help me…
Stupid binary tree traversing
Programming
Software Development
14 Years Ago
by lyxus
Hello Guys, I am
traversing
a binary tree in java. I can print the whole …
please help me getting the code of traversing in-fix to post ansd prefix binary tree?
Programming
Software Development
14 Years Ago
by soul310
how could i get the code of
traversing
in-fix to post and prefix binary tree?? please help??
Trouble traversing Btree
Programming
Software Development
14 Years Ago
by UberJoker
… i=0; memset(SearchKey,0,4); cout<<"
Traversing
Ascending Order"<<endl; while(i<counter…
What am I doing wrong. Traversing lists and getting data.
Programming
Software Development
13 Years Ago
by SacredFootball
… together float averageScore; //totalScore / memberCount struct payload *tempPtr ; //pointer for
traversing
// label // ----- cout << "Members below average: "; // Traverse…
binary tree traversing inorder
Programming
7 Years Ago
by Usman_9
the compiler compile the code,but
traversing
output is wrong .please chech ny logic is correct,tell …
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
you can start by deleting line 516 because it is nothing more than a huge memory leak. When walking backwards you can't check for pCurrent == NULL because what you want to check for is while pCurrent != the head of the linked list, and the head is never NULL unless its an empty list. I assume pWalker is the point at which you want to start …
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Ok, would I just need to make a new pointer like: word *pCurrent; ?
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
[icode]word * pCurrent = pWalker;[/icode] -- just don't use the new operator like you did on line 516.
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Ok, I was trying that, but still couldn't get it right. The head pointer is letter[count]. Here is what I tried that causes a crash: [code] word *pCurrent; pCurrent = pWalker; while (pCurrent != letter[count]) { cout << pCurrent->newWord << " "; pCurrent = pCurrent->back; }…
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
I get a compile error with VC++ 2008 Express because you didn't include <algorithm> to define [b]transform[/b].
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Oh ok.... (and letter[] is defined globally).
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
When I add [inlinecode] cout << "test" [/inlinecode] to see where the crash occurs, it occurs during this line: [inlinecode] cout << pCurrent->newWord << " "; [/inlinecode]
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
I'm starting to step through you program now. So far it is full of memory leaks. First place I see is in the function Initialize_Linked_Lists(). First you allocate a word object then turn around and set the pointer to NULL and return a NULL pointer. Huge mistake. Correct_Word(). When you erase a letter out of the word you have to adjust …
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Hmm, I will have to re-read my material then. I thought you had to allocate memory. :-(
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
you do have to allocate memory, the problem is that you tossed it into the bit bucket by setting it to NULL in the else statement. You should not have commented out the two lines that set the next and previous variables to NULL -- that was correct. Display_words() -- you do have to test pWalker for NUL because I see where a NULL pointer is …
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Hi Ancient Dragon...I appreciate your help. I have to run now, but I will check back in tomorrow and continue working on this. Thank you!
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
hmm, it should actually display the word after it prints out the number of words from that list. Well, I will have to keep playing with it tomorrow. Thanks again.
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
As I said, you are passing a NULL pointer for pWalker. Fix that and it might work the way you want it to.
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Ok, when I traverse the list forward, I stop when pWalker = NULL. The last line of code that does this is: [inlinecode] pWalker = pWalker->next [/inlinecode]. pWalker->next is null, so pWalker is set to NULL. So, in order for me to pass pWalker not as NULL, I will have to back up again in the list before I pass pWalker to the next function to…
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
That's not right. Look at function Display_Results(). pWalker is declared in that function and never set to anything. Its just a pointer that points to some random memory location, unless of course you changed the program since the last post.
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
Well, I use pWalker in the Count_Words() function to traverse the linked list forward (and count the number of words in the lists). So at the end of that function, pWalker is Null because that is when my loop terminates. Then I was passing pWalker out of that function and into Display_Words. Then I created another pointer, pCurrent, in …
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by teppuus
you know, shouldn't walking backwards in a double linked list be just as easy as walking forward?? arrgh
Re: traversing backwards thru double linked list
Programming
Software Development
16 Years Ago
by Ancient Dragon
you need to keep track of the last valid pointer as the loop is iterating through the linked list. Then after the loop terminates reset pWalker to the value of the last known good value. Something like this will probably work. [code] int Count_Words(word *&pWalker, int &count) { int numWords = 0; pWalker = letter[…
1
2
3
15
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC