2,180 Topics

Member Avatar for
Member Avatar for Tiny_trixer

Hi everybody! I'm currently working on an assignment for school. I'm creating a linked list (a line at the liqure store to be exact) and I'm a little stuck. Part of the code: [CODE] public void ekspederKunde() { System.out.println("Velkommen til polet! Vennligst vis gyldig legitimasjon.\n"); if (fremst == null) { …

Member Avatar for Tiny_trixer
0
121
Member Avatar for gabz16

Please help me to transform this phonebook porgram into a linked list phonebook program with delete function..This is my code... [CODE] #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> struct info{ char name[50]; int TelNo; }; struct info gab[50]; int rec=0; char ch; char search[50]; int c; main() { do{ do{ clrscr(); printf("Phonebook"); printf("\n1 …

0
49
Member Avatar for tshudyb

I am not sure how to go about writing a function of a generic type that will transfer the data from a linked-list in one array to the linked list in another array. [CODE] #ifndef LINKED_LIST #define LINKED_LIST template <class T> class ListNode { public: T name; ListNode<T> *next; ListNode(T …

0
58
Member Avatar for vampshay

import java.util.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; // user defined type where we put name class riot2{ private String name; public riot2(String _name){ name = _name; } public String toString(){ return name; } } public class finalriot2 extends JFrame{ Container c = getContentPane(); private Stack sstack; // …

Member Avatar for stultuske
0
75
Member Avatar for sid78669

Can someone please tell me why I might be getting a access violation when doing the following for a double linked list: [CODE=C++] ~DLList() { while(!isEmpty()) //isEmpty is working.. removeHead(); } bool isEmpty() { if(head == NULL && tail == NULL) return true; else return false; } char * removeHead() …

Member Avatar for sid78669
0
954
Member Avatar for bunnyboy

So I have the following implementation of linked list: [CODE=c] #ifndef LINKED_LIST #define LINKED_LIST struct Student { char* name; char* surrname; char* signin_number; char* grade; char* date; struct Student* next; }; struct Student* begin = NULL; void push_back(struct Student* student) { struct Student* temp = NULL; if(begin == NULL) { …

Member Avatar for bunnyboy
0
97
Member Avatar for bgx90

Hello. I am creating a template class derived from another template class to basically mimic the behavior of the STL stack for a school project. I am getting a compile time error when try to use a variable named "copy" when testing the overloaded '=' (defined in the base class) …

Member Avatar for bgx90
0
114
Member Avatar for nanosadra

struct Employee { /* Employee details */ char name[MAX_NAME_LENGTH+1]; /* name string */ char sex; /* sex identifier, either 'M' or 'F' */ int age; /* age */ char job[MAX_JOB_LENGTH+1]; /* job string */ struct Employee *prev, *next; }; static void menu_add_employee(void) { static struct Employee *employee_list = NULL; { …

Member Avatar for Adak
0
214
Member Avatar for atticusr5

Hey everyone, I am trying to get my school program on pointer variable linked lists to work, but I have incountered a runtime error. When I try to print my data to the screen or a file, it does not work. I am not sure if my program is not …

Member Avatar for tetron
0
89
Member Avatar for NitaB

Okay, maybe I'm just overlooking something but I need help. I have this program that reads in some numbers from a file and makes a linked list. The only function that is not working properly is one I called IsThere. Basically, it's just supposed to tell me whether or not …

Member Avatar for NitaB
0
326
Member Avatar for tshudyb

I need to use an array of 5 elements. Each element of the array is a structure with 2 fields: the name of the hotel and a singly linked list of attendees staying in that hotel. Functions are: CheckIn CheckOut Transfer Count Print Quit If someone could just show me …

Member Avatar for tshudyb
0
108
Member Avatar for MyRedz

i was wondering. of all the data structures like list linked list,stack,queues,graph of bfs and dfs. hashing,sorting,searching,arrays...heaps, can anyone of them be solved using computational methods and statistic like linear regression,quadratic regression,trapezoidal rule,simpson's rule..which is to improve accuracy of integral.. just wondering is it possible??

Member Avatar for tetron
0
196
Member Avatar for ace8957

Hello everyone I have been trying to learn the greater mysteries of linked lists and have come across an error that is inexplicable to me at my current level of understanding. I have written a program that attempts to form a linked list to store student information in the form …

Member Avatar for ace8957
0
177
Member Avatar for Forte1292

I need to create a linked list where I can continue to input integers and I'm not sure what I'm doing wrong, but every time I run it I'm allowed to enter two numbers and then I get exit code 216 saying I'm accessing memory I'm not allowed to. [CODE]Program …

Member Avatar for Forte1292
0
167
Member Avatar for sid78669

I have been working on a template class for linked list and sometimes I come across this member function: [CODE=C++] template <class T> bool DLList<T>::deleteData(T data) { ListNode<T> *temp = head; while(temp != NULL && temp->data != data) temp = temp->next; if(temp == NULL) return false; else{ temp->previous->next = temp->next; …

Member Avatar for sid78669
0
96
Member Avatar for sid78669

I have the following classes, SLList, an integer datatype-based linked list and DLList, a template-based linked list. My problem is that SLList is working perfectly, but as soon as i modify it to be used as a template, i get errors, more specifically LNK 2019, i.e. linking errors. I avoided …

Member Avatar for sid78669
1
638
Member Avatar for atticusr5

Hey everyone, I am using Visual Studio 2008 to debug some code where the goal is create a linked list using pointer variables. Here is the main error I am getting when trying to compile: [CODE] error C2227: left of '->Account' must point to class/struct/union/generic type type is 'Link_t' [/CODE] …

Member Avatar for atticusr5
0
142
Member Avatar for xxunknown321

How do i compare two linkedLists so that the onutcome is a sorted linked list from least to greates. Heres my code so far. list1.txt 1 2 3 7 9 10 13 list2.txt 4 5 6 8 11 12 14 how do i compare the two and make it into …

Member Avatar for BestJewSinceJC
0
155
Member Avatar for crozbme

I am trying to count the characters in a linked list. I am receiving a compiler error when this function is tested... **invalid types `char[int]' for array subscript ** [CODE]int slist::count_c(char c) const { slistelem* temp = h; int count = 0; for (int i = 0; i != '\0'; …

Member Avatar for Ancient Dragon
0
126
Member Avatar for mischikun

I'm having a bit of a problem with a group project. We're supposed to use linked lists in it and I've already created classes for the nodes for the linked lists. The only problem is that I need to make the class point to itself but I'm not sure how …

Member Avatar for Murtan
0
183
Member Avatar for xxunknown321

I am having trouble adding information from a ".txt" file to a linked list... here is what i have. list1.txt: 1 2 4 5 6 7 8 11 [CODE] /** The LinkedList1 class implements a Linked list. */ class LinkedList1 { /** The Node class stores a list element and …

Member Avatar for BestJewSinceJC
0
168
Member Avatar for MyRedz

help i need to search and delete a node from a link list but i am not sure of the algorithm can someone please help me with the algorithm and concept need example thanks..

Member Avatar for lotrsimp12345
0
112
Member Avatar for underground111

I NEED HELP WITH THIS ASSIGNMENT. I HAD THE WHOLE ASSIGNMENT DONE AND MY COMPUTER CRASHED AND LOST EVERYTHING. THE ASSIGNMENT IS DUE BY SUNDAY AT ANYTIME. I KNOW PEOPLE DONT LIKE IT WHEN YOU ASK FOR SOMEONE TO DO IT FOR THEM BUT IM NOT ASKING THAT I JUST …

Member Avatar for Nick Evan
0
178
Member Avatar for Broseph

Hey guys. I hate to have to ask for help but I've run out of ideas. The program I'm trying to write is supposed to write a random list of numbers 0 - 4 and then count the occurrences of each number. The only thing I can't get to work …

Member Avatar for Broseph
0
86
Member Avatar for vampgirl13

Hi Guys, So I'm trying to fix a small problem with my code. It does everything correctly but when reading from the file I want to not count the space between words. For instance if the line is Hello world the output should be: 11: Hello world but instead it …

Member Avatar for vampgirl13
0
109
Member Avatar for karolik

So I made a template...I tried declaring a string linkedlist like so... [CODE]LinkedList<string> str; [/CODE] Then i called the function insertLast to insert a string called hello..like so... [CODE]str.insertLast("hello")[/CODE] Then it gives me null pointer error...I cannot see how there can be a null pointer...help would be appreciated..Here is the …

Member Avatar for mattbond
0
182
Member Avatar for xxunknown321

how do i read in files from a ".txt" file into a linked list heres my code. [CODE] import java.io.*; public class LinkedList1 { class Node { String element; // list element Node next; // successor link Node(String el, Node n) { element = el; next = n; } Node(String …

Member Avatar for BestJewSinceJC
0
198
Member Avatar for whoadiz

so I am trying do this problem involving linked lists where i need to basically make 2 linked lists each representing a polynomial. I got all that down... now I need to make a function to add the two polynomials and this is where i got stuck. I have the …

Member Avatar for Ezzaral
0
2K
Member Avatar for DCvonB

Hello, I am trying to create a doubly linked list that will print the entered input in the original order and then print it in the reverse order. Earlier I was able to get it to print the list twice, but the second time was not in the reverse order. …

Member Avatar for DCvonB
0
308
Member Avatar for XiaO yuEn
Member Avatar for Ancient Dragon
0
70
Member Avatar for karolik

So i called my Linked list destructor [CODE] ~LinkedList() { ListNode *current = head; ListNode *nextnode; while(current!=NULL){ nextnode=current->next; delete current; current=nextnode; }[/CODE] and i get.an error...._BLOCK_TYPE_IS_VALID(pHead->nBlockuse) for some reason it doesn't like the "delete current"...I could use some help...thanks.

Member Avatar for Salem
0
115
Member Avatar for FatimaRizwan

This is the operator overloading for the polynomials doubly linked list , this code is working fi9 but i m getting repetition like 1x^1 2x^2 when added with 1x^1 3x^6 2x^1 2x^2 3x^6 but i get those terms also which are subtracted already like i get 1x^1 2x^2 1x^1 3x^6 …

0
60
Member Avatar for FatimaRizwan

I have made an insertion sort function for a doubly linked list of polynomials , i cant figure out the error , please help me with it! [CODE]void insertionSort() { node* temp=head; while(temp->next != NULL) { node* second =temp->next; if (second->exponent==temp->exponent) { temp=temp->next; } else { second->previous->next=second->next; second->next->previous=second->previous; if (head->exponent …

Member Avatar for Fbody
-1
122
Member Avatar for royal33

I need to implement Dijikstra's and Floyds algorithm using a linked list !!! can anyone give a code on how to do it !! because i know to implement it using Matrix but am not familiar with the linked list !! please help me on this !!! The rules of …

Member Avatar for abhimanipal
0
90
Member Avatar for problemkid

Hi i would like to ask what are the advantages of a dummy head linked list and what is the implementation steps? And if it is not too troublesome, i would like to ask how many linked list are there around.

Member Avatar for Narue
0
109
Member Avatar for tinamenon

public class OurList <E> implements OurListInterface <E> { // I. Local classes: // PURPOSE: To hold one data element in the linked list. class Node <E> { // I. Private member vars: E item; Node next; Node prev; // II. Constructor(s): Node (E newItem) { item = newItem; next = …

Member Avatar for Ezzaral
0
153
Member Avatar for cool1_best1

We are using a singly linked list with head pointer to implement Stack ADT. The stack top is maintained at the [B]end of the linked list,[/B] i.e. stack top is the last item. Discuss whether this is a good design in term of time efficiency: In a stack of N-items, …

Member Avatar for mitrmkar
0
155
Member Avatar for atticusr5

hey everyone so for my class in c++ we were asked to implement a linked list in an old program. in the old code i had two classes, and the point of the new code was to take the old code and implement a linked list. I honestly have no …

0
52
Member Avatar for intervade

So I'm working on a linked list class, for a class I'm taking. I've basically just started working on it and I'm getting an unknown error that I really don't know how to deal with. The compiler is not returning an error in my code really, its returning a bunch …

Member Avatar for mitrmkar
0
153
Member Avatar for RatulSaha
Member Avatar for vegaseat
0
147
Member Avatar for aadebayo

Hello I am currently doing a project and I have added a new table to an access database linked to the vb project. I re-linked the access database, but the new table does not appear in the drop down list of the form recordsource. Please can someone tell me what …

Member Avatar for aadebayo
0
96
Member Avatar for react05
Member Avatar for xavier666

Let's say we want to free the total memory used by a linked list in a program, I generally do it like this [CODE]typedef struct linked_list { int some_data; struct linked_list *link; }NODE; int free_memory(NODE * head) { NODE * temp = NULL; if(head == NULL) return 0; // FAILURE …

Member Avatar for Ancient Dragon
0
98
Member Avatar for sleepybug

hey, i came across this program linked linear list about nodes and all and i m literaaly flustered @ understanding it(only the code in LLLIST.CPP----i mention below)....specially with the POINTERS... SO PLZ CAN ANYONE EXPLAIN ME THE WORKING OF THE CODE IN LLLIST.CPP, THAT I HAVE MENTIONED BELOW:icon_cool:.... MAYBE I …

Member Avatar for sleepybug
-2
159
Member Avatar for atticusr5

Hey everyone, I have to take some code and make my a linked list using the accounts class. would i simply have to replace the list class with a struct???? here is my code.... [CODE]//Assignment #6 due 2-8-2010 #include <iostream> #include <iomanip> #include <fstream> using namespace std; //global declarations typedef …

Member Avatar for Ancient Dragon
0
77
Member Avatar for kekekerush

Hey all, I have to program a method that is called makelist, and I'm not sure how to program it. If I already have a list in my external file, how would I grab the list from there? I was thinking of infile.get(char) and keep going until it reaches the …

0
62
Member Avatar for Audux

Hi all, I'm new to C++ after having worked with c# and java for a number of years. I'm having trouble getting my head around destructors and their proper use. take for example this problem i'm working on at the moment. you have a double linked list centered around a …

Member Avatar for mrnutty
0
81
Member Avatar for sepehr_sz

i have received this assignment that i need to complete by wednesday and i havent started. basically i have a .pl file with a movie database and i am required to answer the following. 1. COURSEWORK: There is a game that can be played whereby people try to work out …

Member Avatar for Nick Evan
0
164
Member Avatar for ronnie30

I'm trying to find the Big O for each of these code fragments, for an ArrayList and a Linked List: [CODE] public static int calc( List<Integer> lst, int N ) { int count = 0; for ( int i=0; i<N; i++) { if (lst.get(i) > 0) sum += lst.get(i); else …

0
43
Member Avatar for spirit3ch

Hi guys, I am supposed to implement a sequence using linked list. But I seem to have an error in the code. As I am getting trash for the results of the concatenate function. It might be a problem with my constructor too. I am not sure. Please help. I …

Member Avatar for spirit3ch
0
1K

The End.