Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
linkedlist
- Page 1
Re: Linkedlist program doesn't work
Programming
Software Development
9 Years Ago
by stultuske
>
Linkedlist
program doesn't work can you be a bit more specific abou the "doesn't work" part? does it compile? do you get compile time exceptions? does it run? do you get runtime exceptions? does it run but produces unexpected results? what do you expect, and what do you get?
Re: Linked List
Programming
Software Development
19 Years Ago
by Chainsaw
LinkedList
::deleteLL() has no return value. That's why the compiler thinks it looks like constructor. Also, minor point, the
LinkedList
:: is not nescessary since you are enclosed in that class.
Re: compile error-chained hash table c++
Programming
Software Development
19 Years Ago
by Chainsaw
LinkedList
is a class, not a variable. It's sort of like saying int = 4;
LinkedList
MyList; MyList.add( value ); // this would work…
LinkedList
.add(value); // this wont Also, you…
LinkedList Help
Programming
Software Development
16 Years Ago
by USUAggie
…I hope you all can help me with. [B]
LinkedList
.h[/B] [code=C++] #pragma once #include… namespace std; template < class T > class
LinkedList
{ private: class ListNode{ public: T value; // Node …void displayList ( void ); }; //
LinkedList
[/code] [B]
LinkedList
.cpp[/B] [code=C++] #include "
LinkedList
.h" template < class T…
Re: LinkedList Help
Programming
Software Development
16 Years Ago
by dougy83
….e. [code] // header file template<class T> class
LinkedList
{ //... public: void AddNode(){ // addnode code here... } }; [/code] Check out the…
LinkedList
Programming
Software Development
15 Years Ago
by robertmacedonia
… class I am trying to implement a
LinkedList
<Kontakt>, i.e. a…public class PhoneBook { private
LinkedList
<Kontakt> list; public PhoneBook(){ list = new
LinkedList
<Kontakt>(); } public…quot;Bogdanoski",14);
LinkedList
<Kontakt> list = new
LinkedList
<Kontakt>(); list…
LinkedList
Programming
Software Development
13 Years Ago
by Donnovan
Hi everyone, how do i push item with a givin index in a
linkedlist
. e.g.
linkedlist
.add(element e, int index); this is my function [CODE]public void push(Student s, int index){ if(isEmpty()){ start = s; }else{ last.next = s; } last = s; size++; }[/CODE]
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by karolik
…Attempt to use null pointer") {} };
LinkedList
<T>(); ~
LinkedList
<T>();
LinkedList
(const
LinkedList
<T>& ll); // copy constructor…; current=nextnode; } } template<typename T>
LinkedList
<T>::
LinkedList
(const
LinkedList
<T>& ll) // copy constructor { head…
LinkedList overload [] operator help
Programming
Software Development
15 Years Ago
by USUAggie
… T> class DuplicateException{}; template < class T > class
LinkedList
{ private: class ListNode{ public: T value; ListNode *next; ListNode (…message = message1.str(); } }; }; template <class T> T &
LinkedList
<T>::operator[](int posistion){ ListNode *ptrNode; int countItems…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mattjbond
… current; current=nextnode; } head=0; } // destructor
LinkedList
(const
LinkedList
& ll) {//O(n) head=0; tail=0;…insertLast(current->getElem()); } } // copy constructor
LinkedList
& operator=(const
LinkedList
& ll); // assignment operator // query function…
LinkedList Template in Multi-File Project
Programming
Software Development
14 Years Ago
by dotnabox
… template< class T > class
LinkedList
{ ListNode< T > *head; public:
LinkedList
(); ~
LinkedList
(); const Day& operator[](int index)const…) { } // ListNode() template< class T >
LinkedList
< T >::
LinkedList
():head(NULL) { } //
LinkedList
() [/CODE] year.h: [CODE] class Year { int count…
Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by karolik
…current; current=nextnode; } head=NULL; } // destructor
LinkedList
(const
LinkedList
& ll) {//O(n) head=NULL; tail=NULL;…insertLast(current->getElem()); } } // copy constructor
LinkedList
& operator=(const
LinkedList
& ll); // assignment operator // query function…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mattjbond
…current; current=nextnode; } head=NULL; } // destructor
LinkedList
(const
LinkedList
& ll) {//O(n) head=NULL; tail=NULL;…insertLast(current->getElem()); } } // copy constructor
LinkedList
& operator=(const
LinkedList
& ll); // assignment operator // query function…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mattjbond
… current; current=nextnode; } head=0; } // destructor
LinkedList
(const
LinkedList
& ll) {//O(n) head=0; tail=0…insertLast(current->getElem()); } } // copy constructor
LinkedList
& operator=(const
LinkedList
& ll); // assignment operator // query function…
linkedlist in C++
Programming
Software Development
12 Years Ago
by shyla
… [CODE]#include<iostream> #include "
linkedlist
.h" using namespace std;
linkedlist
::
linkedlist
( const
linkedlist
& otherList ) { head = NULL; listNode… listNode *next; }; listNode *head; public:
linkedlist
() { head = NULL; } // copy constructor
linkedlist
( const
linkedlist
& otherList ); //add member fuunction void add…
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by shyla
… [CODE]#include<iostream> #include "
linkedlist
.h" using namespace std;
linkedlist
::
linkedlist
( const
linkedlist
& otherList ) { head = NULL; listNode *…struct listNode *next; }; listNode *head; public:
linkedlist
() { head = NULL; } // copy constructor
linkedlist
( const
linkedlist
& otherList ); //add member fuunction void add(…
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by shyla
… [CODE]#include<iostream> #include "
linkedlist
.h" using namespace std;
linkedlist
::
linkedlist
( const
linkedlist
& otherList ) { head = NULL; listNode … = newNode; tempPtr = newNode; nodePtr = nodePtr->next; } } void
linkedlist
::add( double x ) { listNode *newNode; listNode *nodePtr; listNode *previousNode =…
Linkedlist loses elements after shuffling
Programming
Software Development
9 Years Ago
by Necrozze
…Shuffled list: "+shuffle(list)); } public static
LinkedList
shuffle(
LinkedList
list){ Integer node = 10; if(list.size()&…list; }
LinkedList
<Integer>list1 = new
LinkedList
<>();
LinkedList
<Integer>list2 = new
LinkedList
<>();…
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by Moschops
… you the same thing over and over. This line: [B]
linkedlist
::isMumber(double x)[/B] You need a return type on…. That means that at the front of it, before [B]
linkedlist
::isMumber[/B] you must put the type of object that… put bool on the front on [B]
linkedlist
::isMumber[/B], like this: [B]bool
linkedlist
::isMumber[/B] The second problem is that…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mattjbond
…usage for your linked list would be something like [CODE]
LinkedList
<char> char_list; char_list.insertLast( 'C' );…done this you now need to address you
LinkedList
class ans parameterize this so that it can…. Something like... [CODE]template<typename T> class
LinkedList
{ private: ListNode<T> *head, *tail; public…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by karolik
… you explicitly call your class destructor. e.g. [CODE]void
LinkedList
<T>::removeAll()//O(n) { /* Complete this function; * This… the nodes in the linked list */ head=NULL; this->~
LinkedList
();[/CODE] This is not a good idea. I'll leave… have the null pointer exception error when i make a
linkedlist
of strings...
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by Moschops
To recap:
linkedlist
.h - missing semi-colon on end of line 20 missing semi-colon on end of line 22
linkedlist
.cpp - line 59 should read [B]bool
linkedlist
::isNumber(int x)[/B]
Re: LinkedList overload [] operator help
Programming
Software Development
15 Years Ago
by USUAggie
Sorry, thought posistion would be obvious. It is the same as myList[45] the 45 would be passed to the overloaded operator. It reads it correctly if the array index is out of bounds for the
linkedlist
, but I do not seem to be getting the correct value passed back, because when ever I do something like myList[1]=5, the value does not change.
Re: LinkedList overload [] operator help
Programming
Software Development
15 Years Ago
by USUAggie
… advice? [code=c++] template <class T> T &
LinkedList
<T>::operator[](const int posistion){ ListNode *ptrNode; int…
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mattjbond
… you explicitly call your class destructor. e.g. [CODE]void
LinkedList
<T>::removeAll()//O(n) { /* Complete this function; * This… the nodes in the linked list */ head=NULL; this->~
LinkedList
();[/CODE] This is not a good idea. I'll leave…
LinkedList Question
Programming
Software Development
12 Years Ago
by minimi
…Node { Node *pPreviousNode; void *pData; Node *pNextNode; } ; struct
LinkedList
{ Node *pFirstNode; Node *pLastNode; } ; struct StudentInfo { int id…// Step 1: Construct our Linked List with sentinel nodes
LinkedList
*myLinkedList = (
LinkedList
*) malloc(sizeof(
LinkedList
)); Node *firstNode = (Node *) malloc(sizeof(Node)); …
Re: Linkedlist Template with strings...
Programming
Software Development
14 Years Ago
by mrnutty
This function : [code] void
LinkedList
<T>::insertLast(T newobj)//O(n) { ListNode<…
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by mike_2000_17
In your header, you need to match the [ICODE]#ifndef linkedlist_H[/ICODE] with a [ICODE]#endif[/ICODE] at the very end of the header file. In your cpp file, if you want to use the type listNode, you have to fully specify it, i.e. [ICODE]
linkedList
::listNode[/ICODE], otherwise the compiler won't find it.
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by JasonHippy
… compiler is mentioning the problems with listNode is because the
linkedList
class itself is failing to compile due to the afore…
Re: linkedlist in C++
Programming
Software Development
12 Years Ago
by Moschops
[CODE]
linkedlist
::isMumber(double x)[/CODE] You need the return type on the front of that.
1
2
3
17
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
Meet People
Forums
Top Members
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