285 Topics

Member Avatar for
Member Avatar for vishal1949

I am making a program of a bowling tracker. I made four names and then I have to add specific dates they played and then the score they got on those days. Then print to screen the names, the number of games they played, average score, last games score and …

Member Avatar for NormR1
0
410
Member Avatar for termin8tor

Hey all, I've been programming an ISBN system of sorts and I'm a little stuck (again). I want to output my linked list to a text file, so I setup the code like this: [code] void saveList(char fileName[40]) { for ( list< Publication* >::iterator it = pubList.begin(); it != pubList.end(); …

Member Avatar for termin8tor
0
262
Member Avatar for termin8tor

Hey all, I'm attempting to use an STL List to store a list of objects. Now I realise it's quite trivial to store a list of objects of my own definition. My real question is, how do I fill the list with objects that inherit from a base class. E.g. …

Member Avatar for termin8tor
0
267
Member Avatar for termin8tor

Hey all! I'm new to the forum and a little wet around the programming ears so to speak. Anyway I have a question regarding Linked Lists. I know that typically a linked list looks like this: [CODE] struct Node { dataType varName; //data type and variable name Node *next; //points …

Member Avatar for jinhao
0
162
Member Avatar for saransh60

[code] class List(): def __init__(self,values=0): self.numb=values self.linker=self def add(self,values): self=self.linker self.numb=values self.linker=List() def show(self): while self!=self.linker: print self.numb self=self.linker [/code] In main call i want some thing like this [code] list1=List() list1.add(43) #i want to add numbers to liked list node like this list1.add(22) list1.add(938) list1.show()#Then retrieve it from the …

Member Avatar for jLocke
0
278
Member Avatar for bbyynn

Hi all, I just make a program and I get in trouble about set method.so anyone can help me? [CODE] import java.util.LinkedList; public class Polynomial { private LinkedList<Integer> coeff = new LinkedList<Integer>(); private int deg = 0; /* Constructs a new polynomial of degree zero */ public Polynomial() { } …

Member Avatar for peter_budo
0
187
Member Avatar for arunkumar267

#include<iostream> using namespace std; class polynomial { private: struct p { int degree; float coefficient; p *link; }*head; public: polynomial() { head=NULL; } void getdegree(); void getpolynomial(int d); void display(); void addition(polynomial p1,polynomial p2); }; void polynomial::getdegree() { int degree1; cout<<"\n Enter the highest degree of your polynomial:"; cin>>degree1; getpolynomial(degree1); …

Member Avatar for arunkumar267
0
281
Member Avatar for shylesh_kerala
Member Avatar for fibbo

I just cant get my head around it. Is there another way going through a singly linked list without using some kind of helper function? The header file wants me to implement: [CODE]size_t priority_queue::size() { /* code here */ }[/CODE] Now I just could create a helper function that has …

Member Avatar for fibbo
0
356
Member Avatar for GolfGr

Hello guys im working on a project for my class and im stuck. i dont have much of experience with linked list and my book isn't helpful with this project. Here is what the project is about: Develop an interactive program to implement basic linked list operations including: 1. Add …

Member Avatar for GolfGr
0
166
Member Avatar for Rimojenkins

Hello. I'm currently making a program that deals with a priorityQueue and inheritence/polymorphism. Student -> undergrad -> coop_student or student -> grad Now, the queue takes in the data and just puts it in a linked list and gives it a priority. That way, there are 3 queues and we …

Member Avatar for LevyDee
0
261
Member Avatar for rhuffman8

I just started looking at iterators in my C++ class and don't think I fully understand enough about them to actually create one. I need to add an iterator to this doubly linked list program: [CODE]#ifndef CSLIST_H #define CSLIST_H #include <iostream> #include <cstdlib> using namespace std; template <class T> struct …

Member Avatar for rhuffman8
0
276
Member Avatar for rockerjhr

globals.h [CODE] #ifndef _globals #define _globals #define NEXT(L) ( (L) -> next ) #define DATA(T) ( (T) -> datapointer ) #define LEFT(T) ( (T) -> left ) #define RIGHT(T) ( (T) -> right ) typedef enum { OK, ERROR } status ; typedef enum { FALSE=0 , TRUE=1 } bool …

Member Avatar for WaltP
0
180
Member Avatar for lilbenji25

Hey, i know you are all probably very bored with the infix to postfix program and its many incarnations but i seem to be having a problem getting the linked list we have to use as a stack to work. More specifically; pushing to the stack, reading from the top …

Member Avatar for nezachem
0
179
Member Avatar for IamAuser

Hello all, here is the code I came up with for implementing a circular linked list. I get a segmentation fault when I create the list with just one node. With size > 1 circular list works fine! Im not sure but I think it may have something to do …

Member Avatar for IamAuser
0
269
Member Avatar for virtue

Hi all, I wrote a program that has many functionalities but I can not swap 2 elements of 2 nodes in the linked list.Actually I can swap 2 nodes by changing their links but I can not swap 2 elements when the user requested 2 elements swapping.Here is my code …

Member Avatar for Ancient Dragon
0
175
Member Avatar for dondajr

Hi everybody o/. I'm studing Linked List in C. I made two functions: add ( add data on the list) and destroy (destroy the list). For now, it's just this two functions that i need, but the function destroy doesn't works well. When I call the function destroy only the …

Member Avatar for dondajr
0
265
Member Avatar for leftovas17

Yes, I have looked in the forums for answers and have found plenty, and am asking about what I could not find. And yes, this is homework, but I need help and my professor has not responded thus far... now on to business. Description of Goal: Make a Set Data …

Member Avatar for leftovas17
0
473
Member Avatar for virtue

Hi, I wrote a program that inserts nodes into a linked list in descending order.But whenever I test my code with numbers 12,14,13,19,7 in this order.Whenever I entered 7 I took 7 is already in the list.But as easily seen 7 is not in the list before I inserted.After give …

Member Avatar for sourabh17
0
133
Member Avatar for hhaannyy

I have a program that works access 2003 and i convert tables to sql Server 2005, but the problem is that program works only on the server but does not work on client .the internal network is workgroup and system is Windows XP . what can i do to get …

Member Avatar for hhaannyy
0
198
Member Avatar for AnthonyJ

I have an assignment where I need to do some operations on polynomials (add, multiply, ...) which are represented by linked lists. Part of the assignment is to make an inner class Term containing two int fields and a constructor with coef and exp ints) I also need an inner …

Member Avatar for JamesCherrill
0
381
Member Avatar for Hojjat.Mojallal

There are n persons numbered from 0 to n - 1 standing in a circle. The person number k, counting from the person number 0, is executed. After that the person number k of the remaining persons is executed, counting from the person after the last executed one. The process …

Member Avatar for Hojjat.Mojallal
0
374
Member Avatar for Mabyboi

So im working through this and im having troubles finishing it off. Essentially im reading a text file, and tokenizing the numbers in the file, but what needs to be done is for each line in the file to be store in its own Queue, and then the Queue's need …

Member Avatar for Taywin
0
1K
Member Avatar for hauda67

Is it possible to write a method and declare something like [CODE]Node currentNode;[/CODE] to "scan" through each nodes in the list, and saving to file. I guess I can use [CODE]import java.io.*;[/CODE] to declare the necessary file stream variables. Would really appreciate some ideas and tips on how to approach …

Member Avatar for jon.kiparsky
0
139
Member Avatar for isamuhunter

Hello everyone...I'm trying to create a journey planner for an underground system...but the first thing Is to create the skeleton of the underground system... my problem is I don't know how to add more links to a single node when the station has an intersection with other lines... [CODE]public class …

Member Avatar for isamuhunter
0
2K
Member Avatar for ana_1234

Hi, I am working on some practice problems for my class and I keep getting stuck on this problem. It is using linked list, I am bit stuck. The problem is to write a function int testloop (listnode *head) that checks to see whether the list 'head' contains a loop. …

Member Avatar for mrnutty
0
142
Member Avatar for elsiekins

Hi - i have been trying to create a linked list in C using structs and there are a couple of things i am stuck with how to declare the node front and back and do i keep repeating myself? Also in the function push back how can i use …

Member Avatar for elsiekins
0
279
Member Avatar for speedofdark

Hey all, I've used this site quite a bit as a reference, and couldn't find a solution that worked for me. So I became a member. :) Anyway, I can't get my insert function to...function when I go to add a node. The node is NOT to be just added …

Member Avatar for speedofdark
0
218
Member Avatar for jugadengg

hi please solve my problem i am getting linking error in following program. i am using devc++ for copilation linking errors: C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x286) In function `ZN4list7delnodeEi': C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x286) In function `ZN4list7delnodeEi': [Linker error] undefined reference to `list::search(int, Node**, Node**)' C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x62c) ld returned 1 exit status [CODE]#include<iostream> #include<conio.h> #include<string.h> using namespace std; class …

Member Avatar for gerard4143
0
221
Member Avatar for vin24

Hi, I created a program using the linkedlist package. I encountered an error when I tried to insert an element... By the way here's my code... [CODE] import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.*; class guiListOperations3 extends JFrame implements ActionListener { static LinkedList <String> list=new LinkedList <String>(); static JLabel …

Member Avatar for ztini
0
173

The End.