2,180 Topics

Member Avatar for
Member Avatar for Zcool31

I'm trying to implement a linked list class in a manner similar to STL. Everyithing seems to work fine, but when I try to implement an output operator to let me see what is inside the collection quickly, it starts acting wierd. Note that I use the iterator inside the …

Member Avatar for Zcool31
0
247
Member Avatar for Nine Tails

I am trying to create a widget that will display information for a large number of items. This widget needs to have the following properties: 1.) Highlights a line on a left mouse click 2.) Has an accessor function that can be used to retrieve the line number that is …

0
98
Member Avatar for student_x

given a queue: queue<int> myqueue; write a function to remove the last entry in the queue. remark: you can't use stack, pointers, or linked list to do that. You can only use functions such as myqueue.pop(), myqueue.front() etc... Anyone has any ideas?

Member Avatar for student_x
0
6K
Member Avatar for monocog

Nucleon was nice enough to provide me with the following code to help learn lists a while back. I've had a little more time to revisit lists again and would like to see what this code looks like using a linked list instead of an array.. This is NOT homework, …

Member Avatar for Lerner
0
96
Member Avatar for christiangirl

Hello, I need to make this program sort the numbers entered with merge sort then print them. I am having trouble calling merge sort and getting it to print. Here is the code: [code] #include <iostream> #include "queueLinkedList.cpp" using namespace std; /*struct Item : Data { int value; Item *next; …

Member Avatar for christiangirl
0
199
Member Avatar for christiangirl

Hello, I am having trouble understanding linked lists. I have to make this program that takes input, stores it to a queue, outputs that input, then sorts it using mergesort and outputs it again. It all works except I'm not sure how to call the mergesort classes. Here is the …

Member Avatar for christiangirl
0
232
Member Avatar for sat4ever0606

[B]For inserting a node at the beginning y the foll code wont work?[/B] [code] struct node { int data; struct node *-next; }*head,*run,*ptr; typedef struct node n; void create() { if(head==NULL) { head=n*(malloc(sizeof(n)); } else { ptr=n*(malloc(sizeof(n)); ptr=head; scanf("%d",&ptr->data); head=ptr->data; ptr=ptr->next; } [/code]

Member Avatar for death_oclock
0
148
Member Avatar for Drifter666

Hey All, I'm having this weird issue and I'm not sure what to do. In the main function when I put one letter it'll work, once I put a string of letters it doesn't work. I've tried an assortment of stuff and I dunno what to do anymore. This is …

Member Avatar for Drifter666
0
3K
Member Avatar for sfrider0

I have an assignment to use templates for a linked sorted list. The SortedType.h file is in our book and that is what we have to change. I understand how to do all of that and it compiles and everything. When I create a driver to test it, I just …

Member Avatar for sfrider0
0
482
Member Avatar for stickboy

Okay so I have a problem that involves assigning random masses to cars and assigning these into random positions (on a "grid" if you would like to picture it that way) which will eventually move around and cars with a bigger mass will destroy the smaller ones and then I …

Member Avatar for IVR_Developer
0
95
Member Avatar for Duki

Hey guys, Can anyone tell me why this doesn't work in VS2008? I've commented out the #includes and whatnot so you can paste it into a single .cpp file and run it. Here are my errors: [quote]1>test.obj : error LNK2028: unresolved token (0A000320) "int __cdecl eval(class Tree<struct InfoNode> &)" (?eval@@$$FYAHAAV?$Tree@UInfoNode@@@@@Z) …

Member Avatar for Duki
0
410
Member Avatar for TheFueley

Hello all, I am trying to make a linked list (class-based). I'm not sure if I went actually did it right. I get a compiler error on the segment of code that deals with printing the linked list to stdout. Here is the seqment in question. [code=cpp] // print contents …

Member Avatar for TheFueley
0
185
Member Avatar for Carrots

Hi! I was hoping for some advice on how best to create a single doubly-linked list which could contain all of the different types of classes I have. This is the code I have written so far.... [B]shape.h:[/B] [code=C++] class Shape { public: Shape (int l=0, int h=0) : length(l), …

Member Avatar for Intrade
0
126
Member Avatar for Falkoner1

Okay, I'm trying to have a linked list autonomously delete itself, however, the destructor function I am using doesn't seem to work, it just keeps constantly looping, until the program just ends itself. Here's the function: [CODE]node::~node() { if(this->next != NULL){delete this->next;} delete this; }[/CODE] Basically, this should run through …

Member Avatar for Falkoner1
0
170
Member Avatar for Barefootsanders

Hi, I'm trying to code a program that involves a double linked list. I have the linked list working but the information in the link list need to be shared between 2 different classes. Is it possible to pass a linked list as reference and manipulate it within the different …

Member Avatar for SeeTheLite
0
115
Member Avatar for TriniBabe

please help i think d error is in inputtin d values into d linked list! D files are attached

Member Avatar for Nick Evan
0
75
Member Avatar for TriniBabe

U are given the data(startnode,end node,cost) for each edge on a separate line but u dont no how much nodes u hav b4 hand how u declare it? how do u link the nodes in an adjacency list using linked list and not d <vector>?

Member Avatar for DemonGal711
0
110
Member Avatar for Vanq69

Hi guys, Firstly I am using Scriptaculous to implement the sortable list but have looked there and not been able to find any reason for this to be occurring. I have a list of sortable items, there are 2 droppables enabled with the list, 1 to delete it and the …

Member Avatar for Vanq69
0
80
Member Avatar for cpsc1892

I'm studying for one of my exam's and this is my first c++ class and my professor gave one of these questions for our study guide... and I'm having trouble with it. And since our final is open book and open notes he's not giving us the answers, and i've …

Member Avatar for cpsc1892
0
2K
Member Avatar for ceyesuma

[i] Topic The topic of this question is: tracking the content of an array in a session bean debug sessionbean1.java [/i] [icode] Hello and Thank you in advance for any assistance. [/icode] [u] [b] Purpose: [/b] [/u] [b] The purpose of this code is to try to find the best …

0
57
Member Avatar for bobrien314

I have this assignment to write my own malloc program and I am having some trouble. I am using a doubly linked list to manage free space and used space, and using next fit to allocate the memory. the problem that i am writing about is when i return the …

Member Avatar for nucleon
0
107
Member Avatar for JAGgededgeOB172

Hi all, I'm just asking for help for my linked list sort function, I'm not including my entire program, as I'm sure my problem lies in my sort. I need to sort the linked list by rearranging the pointers, I was fairly sure I got the function correct. When I …

Member Avatar for JAGgededgeOB172
0
104
Member Avatar for shahab.burki

Hi, I am implementing Linked List in Java. I am using three classes for this i.e Data Class, Node Class and Linked List Class. Now the problem is that a searchNode method in my linked List class doesn't work properly. I have tried to debug it it, but can't understand. …

Member Avatar for darkagn
0
95
Member Avatar for Avaviel

Here is the [url=http://dl.getdropbox.com/u/297962/Lab7.zip]whole project[/url], in a zip file. I'm having trouble getting the delete function to work. I can delete head just fine, but when I try to delete either something at the end, or something in the middle, it does not work out. I'm sure it has something …

Member Avatar for Avaviel
0
114
Member Avatar for yangty152

I am doing my school project, and I cannot copy the linked list correctly. When I assigned temp to this, nothing happens. I believe I put all the related code below, any help will be appreciated. void poly::read () { // Pre: None. // Post: A new value is read …

Member Avatar for yangty152
0
186
Member Avatar for moshe5

So the assignment is to create a Sorted Linked List, not doubly, and not using a tail. I am using a SortedListNode Struct in the private area of the SortedList class. I think this is causing problems. I have the logic, and I was on the verge of succeeding, but …

Member Avatar for moshe5
0
260
Member Avatar for tones1986

Hi all, I recently finished working on a project that was to create a database type system for a student registration system. I created my own list class and stack to store the data... i create multiple classes, person (store student data: name, ssn, etc), student (student ID number), courseInfo …

Member Avatar for tones1986
0
152
Member Avatar for phoenixlsk

hi i need some help. i have to do a linked list using XOR and i don't know how to do it. thanks

Member Avatar for manojthesingham
0
376
Member Avatar for shahab.burki

Hi, I am stuck in implementing the linked list in Java. I am using three classes to construct Liked List. One is Data Class (for holding Node's Data), Node Class (which encapsulates the Node properties) and a Linked List Class. Though it creates a successful linked list, but when I …

Member Avatar for BestJewSinceJC
0
153
Member Avatar for tasneemnikhat

hey ol, i dnt hav much time left to solve des Q's.. can u plz guide me solving des... Fundamental Exercise /* class design, dynamic memory allocation and operator overloading */ 1. Write a program to implement Matrix class. • Implement addition and multiplication operation • row and col of …

Member Avatar for tasneemnikhat
0
121
Member Avatar for Duki

Hey guys, I'm getting an error at lines #9 and #14. Could someone tell me what I'm doing wrong? [code=c++]StackType::StackType(const StackType & st) // copy c-tor { if ( st.topPtr == NULL ) topPtr = NULL; else { NodeType * stptr; // pointer to source Stack NodeType * p; // …

Member Avatar for Duki
0
178
Member Avatar for Dewey1040

i half understand this code, just wondering if anybody could give me helpful tips/hints about understanding the difference between these two functions [code=C] extern status traverse( list L, status ( *p_func_f )() ){ if( empty_list ( L ) ) return ( OK ) ; if( ( *p_func_f ) ( DATA( …

Member Avatar for Ancient Dragon
0
104
Member Avatar for hansel13

I need to create a search function that search for a product type. If it's found, I return true, otherwise i return false. My client program will output the data that was found (if true), otherwise it'll output an error message saying that product type does not exist in the …

Member Avatar for DemonGal711
0
145
Member Avatar for ahfan_85

I have a question here: Complete a program that performs following operations by using C++ programming: a.Enable user to create and manipulate a list of items (must be able to read integers, characters and strings). b.Enable user to sort the list. (any sorting algorithm except naïve sort) c.Enable user to …

Member Avatar for ahfan_85
0
127
Member Avatar for Seapoe

Hi, I'm new here and need some help on beginning my program. I've read the thread on homework help and am not here asking for someone to do my program. I have an assignment which I basically have to take in polynomials from the user and add/multiply them. I decided …

Member Avatar for monkey_king
0
109
Member Avatar for azwraith69

hello,,:) i have problem doing a FOR loop in my linked list,, it doesn't start the loop,, i don't know why... [icode]class node { public: node(int number, node*nxt):number(number),nxt(nxt){} int getNumber(){return number;} void setNumber(int number){this->number=number;} node* getNxt(){return nxt;} void setNxt(node *){this->nxt=nxt;} private: int number; node *nxt; }; bool mergeList(node *&result, node …

Member Avatar for kbshibukumar
0
146
Member Avatar for redhotspike

Ok, so I am befuddled. Each individual file compile fine, no errors. When I compile all together and create an executable, no errors. But, when I run the program, I am getting an error. I have it narrowed down to a problem with my [icode]void LinkedList::insert(const ElementType &dataValue)[/icode] but I …

Member Avatar for redhotspike
0
184
Member Avatar for mmeyer49

My code is supposed to accept into for book data and sort it. My problem is when i enter Data it doesnt return to the menu. i know atm it is // but it seems to fail after i enter the data. Also i'm having problem trying to add the …

Member Avatar for r.stiltskin
0
189
Member Avatar for krispygrimace

First, I apologize for any concept errors about C++. I am pretty new. I am having trouble iterating through each node of a passed linked list. What I have right now is an implementation file with a few functions. The class is called listClass and has a private member function …

Member Avatar for jencas
0
181
Member Avatar for homeryansta

I have a linked list of operators ()+-*/ , how would I be able to compare them if they are all of type char? I looked at the ascii table, but they are all out of order so that isn't a choice.

Member Avatar for homeryansta
0
117
Member Avatar for cbreeze

I am supposed to read in data from a file, create a linked list, and be able to traverse it. I feel like I have the first part of the code correct but I get a segmentation fault when I try and run the program and the pgm4.rpt file is …

Member Avatar for vmanes
0
135
Member Avatar for Reg74

[CODE= C++] //Pg.288 #include <cassert> #include <iostream> using namespace std; void deleteKthElement(int k, int& count); int main() { struct nodeType { int info; nodeType *link; }; nodeType *first, *newNode, *last, *traverse; int num; int count = 0; cout << "Enter a list of integers ending with -999.\n"; cin >> num; …

Member Avatar for Reg74
0
124
Member Avatar for cool1_best1

If the stack top is maintained at the [B]end of the linked lis[/B]t, i.e. stack top is the last item, accessing the stack top would take a lot of time, since N items of the linked list need to be traversed before we can access the last item, This would …

Member Avatar for death_oclock
0
105
Member Avatar for RexxX

I have an assignment I'm working on in C but I didn't want to ask for any code specifically. I just wanted to ask about the methods to use. The program reads a text file where it tells you the number of values to hash. The hash function is completely …

Member Avatar for Narue
0
151
Member Avatar for Dewey1040

I'm still generally new to C, I understand most basic concepts, and were now starting to learn much more complex tasks. Right now im stuck on a program to add polynomials, using linked lists. My book Data Structures - An Advanced Approach Using C, is a real difficult read, and …

Member Avatar for Dewey1040
0
99
Member Avatar for tones1986

hi all. in a recent project i created a linked list to store a students course data...such as course ID, year taken, semester taken, and final grade. This program worked without any problems. now, my next project is to create a stack to store the data, instead of a linked …

Member Avatar for Murtan
0
160
Member Avatar for kingmarsh

As a PowerPoint expert, I often receive a lot of PowerPoint question about sound. Here I pick out four typical questions and supply a solution for each question. Hope it helps you at the process of creating PowerPoint presentation. All the solutions below is taking PowerPoint 2007 for example. PowerPoint …

Member Avatar for erospics4u
0
265
Member Avatar for WesFox13

Hello there, I made this code for an ISBN verifier but there's a problem with it [CODE=C++] #include <iostream> #include <fstream> // REQUIRED FOR FILE STREAMS #include <cstdlib> // FOR DEFINITION OF EXIT_FAILURE #include <cctype> #include <string> using namespace std; // ASSOCIATE STREAMS WITH EXTERNAL FILE NAMES #define inFile "isbntest.txt" …

Member Avatar for daviddoria
0
86
Member Avatar for Mazie

Hi, I was wondering if any old security updates that are installed on your computer have to stay there? If I try to erase them (like 50) it says certain programs will be affected, what's the deal? Why does it load so many updates into my hardware list...half of them …

Member Avatar for Mazie
0
91
Member Avatar for tones1986

Hi all. I am finishing up a project previously posted. I am to create a student 'database' that consist of one student and X number of classes the student has taken. My problem now is that i cannot run a test on the linked list correctly. I am to check …

Member Avatar for DemonGal711
0
714

The End.