2,180 Topics
![]() | |
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 … | |
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 … | |
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? | |
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, … | |
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; … | |
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 … | |
[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] | |
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 … | |
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 … | |
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 … | |
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) … | |
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 … | |
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), … | |
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 … | |
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 … | |
please help i think d error is in inputtin d values into d linked list! D files are attached | |
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>? | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
hi i need some help. i have to do a linked list using XOR and i don't know how to do it. thanks | |
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 … | |
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 … | |
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; // … | |
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( … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … ![]() | |
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 … ![]() | |
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. | |
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 … | |
[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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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" … | |
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 … | |
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 … |
The End.