286 Topics
| |
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 … | |
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(); … | |
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. … | |
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 … | |
[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 … | |
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() { } … | |
#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); … | |
please provide me doubly linked list all algorithms...... | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.