2,180 Topics

Member Avatar for
Member Avatar for grisha83

Hello, For some reason, my program prints out extra zero from my linked list Can anyone tell me why? Thank you [ICODE]public class Main { public static void main(String[] args) { IntNode my = new IntNode(5,null); LinkedList list = new LinkedList(); list.createList(0); list.addValue(1); list.addValue(23); list.addValue(3); list.addValue(4); list.print(); list.getLength(); } }[/ICODE] …

Member Avatar for grisha83
0
91
Member Avatar for tizzo233

[code] // s2.cpp : Defines the entry point for the console application. // Project Stage 2.cpp : Defines the entry point for the console application. /* Algorithm Menu() Choose option Create a new expense Enter the initial amount of money in bank or to add money to bank from paycheck …

Member Avatar for tizzo233
0
154
Member Avatar for jephthah

so im working in an environment (National Instruments) that auto-generates header files for the GUI. in my GUI, i have 150-some odd LEDs arranged in a matrix to represent a large relay bank. my LEDs are named and sequenced numerically like [code]PANEL_LED_1 PANEL_LED_2 ... PANEL_LED_150 etc...[/code] which would allow me …

Member Avatar for jephthah
0
98
Member Avatar for monkey_king

I'm trying to get myself acquainted with memory allocation and deallocation while writing a program that will actually be usefull for me. The program is a simple datareader, that tries to read a matrix from file. The "main" program which works is 'int get_lex(char *in,char *delims,char ***returnvals)' This will essential …

Member Avatar for monkey_king
0
131
Member Avatar for HUPextreme

hi there, i'm quite the beginner at c++, just got to my last project for my course to do. The project asks me to create a family tree using linked list. It says the tree and its components should be templated so it can have a family tree of any …

Member Avatar for HUPextreme
0
860
Member Avatar for Vukinagauna

Please can some one help me here; I have 4 questions to solve /a. Write a member function to check whether two singly Linked List have the same contents. //b.Write a member function to reverse a singly Linked List using only one pass through the list. //c.Insert a new node …

Member Avatar for Vukinagauna
0
100
Member Avatar for adrian_tc

hello guys, if u are kind please explain me why the following function is not correct : [ICODE]void insertAfter(char *);[/ICODE] Here is the implementation. Header File : [code=cplusplus] #ifndef _LinkedList_ #define _LinkedList_ class node { private : char *name; int age; public: node * next; node(); ~node(); char * getName() …

Member Avatar for Lerner
0
100
Member Avatar for bubuzzz

in visual C++, we have to write #include <list> to use linked list and all it funtion. So, where is the actual file (.h, .cpp) that contains the declaration of the linked list? is it in "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\list_o.cpp" Thanks

Member Avatar for Nick Evan
0
75
Member Avatar for grisha83

Hello, I have an assignment where i have to create few methods using linked lists. one of them is method that should create an integer singly list and return the head. While i know how to add a single node i am not sure how to create list of them. …

Member Avatar for hardik.rajani
0
112
Member Avatar for serkan sendur

ok, you are forced to behave logically all the time, since i am a poster who is critisized with rambling off the topic, i give myself and you guys a chance to ramble off the topic as you like with one exception, the rambling will be like a linked list, …

Member Avatar for ditz
0
163
Member Avatar for BlackStar

Can I have some idea's as to how to do that? Like say you have a piece of code that created n lists that are linked. Then you ask which node would you like to change the data? How would one do it? My Idea was the node contains N …

Member Avatar for BlackStar
0
505
Member Avatar for bernadlosini

im given an very tuff assignment like this a. Introduction we have read all input from q sql file.the name of sql file should be read by a command line.please any body help me to do? i tried some. support of SQL of your ADT table to CREATE TABLE, DROP …

Member Avatar for bernadlosini
0
2K
Member Avatar for FotG

I am attempting a cache read simulator that only counts hits and misses. it uses N-way associative cache, and LRU replacement. I have the correct values on what it needs to be, but no matter what I try, I cannot get the correct output. I have a block class [code=c++] …

0
45
Member Avatar for Poab9200

Ok, first things first. Hello everyone, I have a question. How would I go about adding Shortcut Arguments to my program(Code shown below). My idea: I play a game called [I]Counter-Strike:Source[/I] and recently I've needed to gather all the names of custom maps added to the \map directory. To the …

Member Avatar for ddanbe
0
259
Member Avatar for bemo55

Hello. I am trying to do a project with linked lists. It seems that everything is coded correct in my code to create new nodes and move my pointers and such. But for some reason my function that is supposed to print all the names stored in my list only …

Member Avatar for VatooVatoo
0
298
Member Avatar for blackhawk9876

I am having trouble writing these recursive functions. I know I am on the right track, but also know that these functions are not right. Any help would be appreciated. Given the following declarations for a linked list: [CODE]struct NodeType; struct NodeType { int info; NodeType* link; }; typedef NodeType* …

Member Avatar for siddhant3s
0
110
Member Avatar for redmaverick

I am not familiar with C code. I want to convert this code to C++ and run it any help is appreciated. [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> #include<cstdlib> using std::rand; using std::srand; #include <stdio.h> #include <stdlib.h> #include <time.h> /*Global Declarations */ /* define a new type KEY_TYPE as …

Member Avatar for vmanes
0
172
Member Avatar for localp

i need to know the code for insert in middle, and this is what i wrote, i dont get any errors so theres some logic error in it, so please help me by giving me the correct code. [icode] void List::insertATMiddle(const string x) { Node* p = new Node; p->setData(x); …

Member Avatar for Narue
0
82
Member Avatar for BlackStar

struct Fast_Food_Business { string name; Fast_Food_Business* head; Fast_Food_business* tail; }; struct cash_registers{ Fast_Food_Business * regist; cash_registers * r; } struct Customer { int n; Customer * h ; // head Customer *t; // tail Fast_Food_Business*next; }; bool menu (const char& number) { return number== '1' || number== '2'; } bool …

Member Avatar for tux4life
0
124
Member Avatar for BlackStar

say you have [ICODE]struct Node{ int item; Node *next; } int main() { Node *p; p= new Node; p-> item = 100; p-> next = NULL; }[/ICODE] is there a way to make it that, the p-> item becomes whatever the user inputs?

Member Avatar for BlackStar
0
329
Member Avatar for loveforfire33

hi, im currently revising linked lists for my exams - but i cant quite understand the reasoning behind using current or current.next in the following examples in the example below we are adding to the back of a linked list [CODE]void addToBack(int value) { // make a new element Element …

Member Avatar for loveforfire33
0
157
Member Avatar for gamodg

Hi I have a cgi controller that takes requests and depending on request it invokes the object of the desired class which generates a XML and sends the XML as a response. On the client this XML is combined with XSL to display a HTML page. For ex. [CODE] request---->controller------->router.cgi(a …

Member Avatar for Salem
0
73
Member Avatar for scuzzo

I have everything almost done, the only problem I have is that I can't seem to get the linked list to advance when the terms start out with different exponents and instead of just printing the results I will tie them into a third list. Can you see what I'm …

Member Avatar for NathanOliver
0
108
Member Avatar for bmcutler011

[code]#include<iostream> #include<fstream> using namespace std; int main() { dnode<double> *listA = new dnode<double>; dnode<double> *listB = new dnode<double>; int val1; //first set of integers int val2; //second set of integers ifstream inFile; //declares the inFile //Read in a file to build the two lists inFile.open("lnkList.in"); //Open the input file //statement …

Member Avatar for Ancient Dragon
0
105
Member Avatar for faniryharijaona

Hi All, I've got a problem with the python class. I want to create a list of object of type obj() and link them such that the next of one object is the next in its place order. I tried this construction [code] class obj: ------def __init__(self,cargo=None,next=None): ---------------self.next = next …

Member Avatar for faniryharijaona
0
111
Member Avatar for scuzzo

I almost have my overloaded += operator working. I just need some help polishing it. My problem is that if I put one list as +4x^4 and the other list as +3x^3+2x^2 then the list stays stuck on the first term of the first list. Can anyone throw me a …

0
68
Member Avatar for Duki

Hey everyone, I'm trying to make it so that my ^ operator is right justified within this binary expression tree. For example, 2^3^4 should be evaluated as 2^(3^4). So I should get 2^81, instead of the usual 2^12. Here is the code I have so far. Everything works, except the …

Member Avatar for Duki
0
487
Member Avatar for jesseb07

hey, I got a question regarding functions returning a linked list. Here's the data structure of my linked list (just in case it deviates from the standard way of doing it) [CODE] template <class T> class Link { private: unsigned int size; Link<T> *nextRow; Cell<T> *firstCell; public: Link(); ~Link(); //functions …

Member Avatar for jesseb07
0
105
Member Avatar for paolomontero

Provided the following template: [code=cplusplus] template <class T> class MyTemplate { private: T myData; public: MyTemplate(const T &data) : myData(data) {} bool Contains(const T &); }; [/code] Is there a way to ensure at compile time that the argument T derives from another class? I want T to derive from …

Member Avatar for paolomontero
0
191
Member Avatar for Rastabot

Hey , for my class I have to create an Infinite Integer class which holds can hold a really, really large integer using a doubly linked list. It holds 3 integers per node, so 5,697,343 would be held like [5] [697] [343]. I implemented my constructor and toString method fine, …

Member Avatar for ~s.o.s~
0
332
Member Avatar for bmcutler011

[code] /* Is it possible that someone could give me a pseudo code for what I am suppose to do, step by step. The professor gave us 3 codes and also a infile in which I saved it as InkList.txt. She wants us to create a program as she stated …

Member Avatar for tux4life
0
85
Member Avatar for delifion

Hi guys, I need a help on my assignment. [B]Background[/B] A data transmission system typically breaks a large message into smaller packets. In some systems, the packets can arrive at the destination computer out of order, so that before the application requesting the data can process it, the communications program …

Member Avatar for ArkM
0
636
Member Avatar for bkeenom

I am working a program that imports functions from a file, and stores them as Polynomial objects in a linked list. I have been given a linked list class already built. But i have to make a Database class that performs other operations. I am stuck on one that requires …

Member Avatar for bkeenom
0
130
Member Avatar for 123qwerty123

For the most parts I believe my program is correct, when compiled it doesn't show any errors. The problem that I do have is that I cannot the information on my linked list to print. When the print out comes out it's suppose to show a list of names instead …

Member Avatar for r.stiltskin
0
80
Member Avatar for 123qwerty123

I'm trying to store a list of names in alphabetical order, while implementing this linked list, but I've bumped into some errors. This is what I have: Node.h class node {public: node(node* , node* , node* , node* , node* , node* , node* , node* , node* , node*); …

Member Avatar for tux4life
0
965
Member Avatar for 123qwerty123

I'm trying to store a list of names in alphabetical order, while implementing this linked list, but I've bumped into some errors. I have my problems (like 'node' no appropriate default constructor, and 'first' undeclared identifier). This is what I have: [code] Node.h class node {public: node(node* , node* , …

Member Avatar for NicAx64
0
194
Member Avatar for pbfiddler

I've installed coldfusion and its server. I have two major questions and am completely new to CF. 1. I copied a folder from our website (our hosting company put it together for us) into the wwwroot folder. I am able to access only one of the pages of that folder--the …

Member Avatar for wblakenc
0
194
Member Avatar for jesseb07

hello, quick question regarding template classes and pointers. I'm making a linked list kind of container system, and I'm running into trouble with it when I (don't know if the terminology is 100% correct here) declare an instance of it. An example would be best to explain what's happening: I …

Member Avatar for jesseb07
0
6K
Member Avatar for smsamrc

i have to do a java program to perform polynomial operations. i can manage those operations part. but i have a problem when storing the terms of the polynomial in to a linked list. for example when it is given polynomial("4 2 5 3 6 0"); // 4x^2+5x^3+6 may be …

Member Avatar for smsamrc
0
2K
Member Avatar for sadiekins

Hello. I am trying to write a doubly linked list that uses data from a class. I have this class that I would like to use... [code] #include <iostream> #include <string> using namespace std; class Book { private: int PubYear; //Variables string Title, Author, Genre, Publisher; public: Book( ){}; //Default …

Member Avatar for sadiekins
0
100
Member Avatar for smsamrc

below is a method describes polynomial multiplication. all the insertTail() and insertFirst() are in the normal format of linked lists. can anyone please show me why it doesnt give me the right multiplication. [CODE] public static void mulpolynomial(String poly1, String poly2) { String[] pp1 = poly1.split(" "); String[] pp2 = …

Member Avatar for BestJewSinceJC
0
710
Member Avatar for ganmo

Hello, I've written a delete function to delete any integer value based on in parameter. The problem I have now is that this function deletes the values, but leaves the Node position intact with some huge int value instead. So my question is, do I need to rearrange the Node, …

Member Avatar for ganmo
0
128
Member Avatar for Martin310

Hi guys, I've got a windows form with a datagridview linked to an access database. The third column in the datagridview is a list of numeric values. On load up I would like a textbox to display the average of all the values in this column. Can't quite figure it …

Member Avatar for Martin310
0
510
Member Avatar for endisbegun

so i have some code that ive been working on, and dare i say, understanding, involving linked lists, only i've hit a wall I need to add a new structure, called date, so that a day, month, and year, are associated with every node, for rolls, jam, and tea, and …

Member Avatar for endisbegun
0
128
Member Avatar for sfrider0

I have been working on this for a few days now. I'm just trying to make a deep copy of a template linked list. I have successfully copied the list, but when I enter a new item to the new list, it also adds it to the original list. I'm …

Member Avatar for jencas
0
121
Member Avatar for bsdpowa

Hi, I have a home assignment in C#, I need to make a simple one-way linked list and I'm having trouble. I can make all kinds of linked lists in C++ with no problem at all but I can't do it in C# and that's because I can't access memory …

Member Avatar for bsdpowa
0
114
Member Avatar for sarahnade17

The program I'm trying to write uses a linkedList templated class to manipulate and add polynomials in the form ax^b + cx^d + ex^f etc. The polynomials are stored as linked lists. My problem occurs when I try to add them together. I've added some cout lines to try to …

Member Avatar for sarahnade17
0
114
Member Avatar for senaddor

Hello: I would like to get a good grasp on single linked list. I am looking for easy to read, detailed article on linked list and how we can add, delete, print, insert nodes and such. Hopefully someone has a good suggestion. Thanks.

Member Avatar for Narue
0
112
Member Avatar for jagsrocknfl

I am currently at Kutztown University enrolled in Computer Science II. I am struggling to finish writing the actual cpp for the program, the implementation and header files are finished. Here are the instructions of the program: Recall that a polynomial is a sum of terms in the form, f(x) …

Member Avatar for Lerner
0
2K
Member Avatar for ganmo

Hi, I have some problem to implement the constructors from set.h. There was no problem to implement the empty constructor. But as for: Set(int a[], int n); I have some problem. It is supposed to use insert() function from node.cpp. And since the class Set is friend a friend to …

Member Avatar for Lerner
0
133

The End.