2,180 Topics

Member Avatar for
Member Avatar for mcap61

I have to write a program to check the ranking of the top 1000 boy and girl baby names using linked lists and pointers. I have based most of my work off a tutorial from this website [URL="http://richardbowles.tripod.com/cpp/linklist/linklist.htm"]http://richardbowles.tripod.com/cpp/linklist/linklist.htm[/URL] And here is the link to the list of names. You probably …

Member Avatar for jonsca
0
230
Member Avatar for ericwshoemaker

Hi all, I have a c++ program i'm working on focusing on pointers in a circular linked list. I need to have the user specify the position of the "dog" in the line (the program is a mock dog show). Then a function checks for the specified position and returns …

Member Avatar for ericwshoemaker
0
82
Member Avatar for atohas

Hi, I'm a beginner in C++ and just learned linked lists.I'm trying to write a code which creates a linked list according to the int numbers taken from the user and prints them all.i'm writing the code in Dev c++.However i have a problem in printing the list.By the way …

Member Avatar for atohas
0
65
Member Avatar for charlichickxx

hello, I am trying to write this code to solve the josephus problem. All I am getting is Segmentation Fault(coredump)? i am assuming its something to do with me using calloc but i cant tell what i've done wrong? any suggestions? thanks! [code=c] /*program to give solution of josephus problem …

Member Avatar for jephthah
0
763
Member Avatar for Gem74

help! I am getting an error message, no appropriate default constructor available. I am not sure what I need the default constructor for? how do I correct this? [CODE]#include <iostream> #include <string> using namespace std; struct Node { /** member variables */ int key ; string value ; int x; …

Member Avatar for Gem74
0
2K
Member Avatar for ellimist14

I realize no one is going to want to read through this source code but if anyone does and is able to tell me why I'm getting the errors I'm getting I would be extremely grateful and would pay them back somehow. My code is as follows (I just put …

Member Avatar for shaneselling
0
139
Member Avatar for kele1

i'm trying to write a doubly linked list code but i'm having a lot of errors please help me identify what my problem it please thank you in advance[CODE] #include <stdio.h> #include <stdlib.h> struct listNode { char data; struct listNode *nextPtr; //struct listNode *prevPtr; }; typedef struct listNode LISTNODE; typedef …

Member Avatar for mrnutty
0
145
Member Avatar for jst4pgm

[CODE]#include<stdio.h> #include<conio.h> struct llist { int info; struct llist *next; }; typedef struct llist linked_list; linked_list *start=NULL,*new1; void main() { int menu; void ll_insert() { char ch; do{ new1=create_node(); if(start==NULL) start=new1; else addnode(); fflush(stdin); printf("Do you want to add one more row(y/n):"); scanf("%c",&ch); }while(ch=='y' || ch=='Y'); } linked_list *create_node() { …

Member Avatar for ssharish2005
-1
147
Member Avatar for tzushky

Good morning coders !, I stumbled accross an initialization this morning and even though I get it , it's not 100%. I'll simplify it this way: I have an array declaration: [CODE]uint8_t MyArray[MAX_SIZE][/CODE] I have a linked list structure: [CODE]struct MyLL{ struct MyLL * next; struct MyLL * previous; uint16_t …

Member Avatar for tzushky
0
497
Member Avatar for Carrots

Hi, I have a linked list which stores base class pointers (which point to derived type objects). I'm trying to give this option to the user: [code=c++] cout << "Press 'n' then Enter to show next, 'p' then Enter for previous and 'q' then enter to return to menu" << …

0
77
Member Avatar for ihatestarch

So on the last day of class, I've learned about vectors. They seem like linked list, which seem like arrays. They are all pretty much containers that will hold some object of some data type I believe. Why would someone use one vs. using the other? And is there one …

Member Avatar for ihatestarch
0
142
Member Avatar for kool005

Hi, I have some vertices and edges and i have to create an adjacency list. I have taken an array and stored all vertices in the array. Now i need to add the edges to the graph. The input is given as a text file. When i read "a b …

Member Avatar for mellowmike
0
145
Member Avatar for Carrots

Hi, I have a program, which uses a vector to store some pointers. The program works fine. I'm trying to convert it to use a doubly linked list now though. At the top of the program I changed: [code] vector<Diary *>vectorname; [/code] to [code] #include <list> list<Diary *>vectorname; list<Diary*>::iterator i …

Member Avatar for StuXYZ
0
112
Member Avatar for TrentRodriguez

I have been getting random crashes in the middle of just browsing or when I am installing things. I cant figure it out. I got Windows Ultimate 7 from Windows XP. I deleted the Windows.old file because I thought that was it. Ill link my crash dump and my specification …

Member Avatar for Siberian
0
283
Member Avatar for kool005

Hi, I need to create an adjacency list for a weighted graph. The input is given from a text file. I have created an array assigning each index a vertex. Now i have to link that array with a linked list. For example, vertex 'a' showing all the vertices that …

Member Avatar for kool005
0
69
Member Avatar for complexcodes

Hi guys! I am wondering how can one perform a sorted merge between the calling object list and the the passed in list? Here is what I have got so far : [CODE]#include<iostream> using namespace std; #define NULL 0 template <typename T> class DoublyLinkedList; template <typename T> class Node { …

0
69
Member Avatar for windermere

Here is the LinkedList.h file: [CODE]// LinkedList.h -- class for a linked list as a data structure template <class DataType> struct Node { DataType info; Node<DataType> *next; }; // LinkedList maintains a current position in list after each function call // If an object of a struct is used for …

Member Avatar for bamcclur
0
184
Member Avatar for simonsayz27

Hey everyone. I'm getting REALLY frustrated with this program and I've been working on this problem for too long now. I am building an undirected and unweighted bi-connected graph class which detects all the articulation points. I am able to detect all the articulation points but I cannot figure out …

0
64
Member Avatar for bappee11

hey guys i,m having a bit problem with the programming..... i have to implement semaphore with two function called wait() and signal() using the linked list and array or stack in c++

0
55
Member Avatar for Valaraukar

Hi, I'm trying to update an objects information within my linked list but for some reason after attempting to alter the data no changes appear to have taken place. As far as I am aware I'm not updating a copy of the object because I am finding the relevant object …

Member Avatar for Valaraukar
0
183
Member Avatar for fedya

Hello guys! I have an assignment in my data structure class and I want to ask following thing: I have txt file which is unordered (not sorted) say like this: red apple blue sky white car handsome boy hello world My program should read file into linked list and sort …

Member Avatar for dkalita
0
89
Member Avatar for kat_stephens

I've started on an assignment and just can't get it right PLEASE help! The assignment is :Write a program that will do the following: 1.) Continuously prompt the user for words and store the words in a linked list. Do not use an array or in any way pre-allocate any …

0
106
Member Avatar for natureG

Hello, I am having a problem. The task I have been given is to implement a queue using a linked list. One of the functions of the program is it accept input from the user and write this to a file. The program, thus far, accepts the information, but prints …

Member Avatar for meghana8818
0
882
Member Avatar for wmsigler

I'm having difficulties thinking through the logic of my natural mergesort program. I think I have the split working correctly, but my merge doesn't seem to be working at all, and the pseudocode in my book and what I've found so far on the web is fuzzy. This is a …

0
72
Member Avatar for Ahmed Helmy

Dear all, I practice a program about "stack by linked list" and I found this error [COLOR="Red"]"suspicious pointer conversion"[/COLOR] in the part of defining "push" and "pull" function. Thank you in advance. Ahmed Helmy ITI student.

Member Avatar for Ancient Dragon
0
26
Member Avatar for ganmo

Hey, I am currently following a code skeleton to implement the missing code for some function. Below is only some part of the implementation I've done so far. Yes it is not much yet... I got stuck for the implementation of the [B]list_add()[/B] function. What I want to do there …

Member Avatar for ganmo
0
105
Member Avatar for Valaraukar

Hi, I have created a generic linked list in which different objects can be added to a list as long as they inherit from my object class. My problem is this: I am able to add nodes and find nodes etc. but I can't figure out how to return an …

Member Avatar for GrubSchumi
0
134
Member Avatar for KOFSoldier

Me and a friend have been trying desperately to get this done, but we barely know where to start. We know we need the ifstream to read in from the file, but that's about it. Anyone got any tips for us, please? (Note: we're both fairly new to programming, so …

Member Avatar for KOFSoldier
-4
180
Member Avatar for TheBeast32

Hi, I installed cygwin recently and wanted to do some network programming with it. Since I have never used unix sockets before, I'm reading Beej's Guide To Network Programming. I took this from section 5.1 and tried to compile it. I get a few errors that I can't figure out …

Member Avatar for developer_borja
0
671
Member Avatar for ninreznorgirl2

I'm trying to delete a linked list and Its crashing when i get towards the end of the linked list. [code] void ZapList (NodePtr List) { NodePtr Temp; while(List->Link != NULL) { Temp = List -> Link; //set temp equal to the list pointer List = List -> Link-> Link; …

Member Avatar for mrnutty
0
75
Member Avatar for ninreznorgirl2

[code]void DeleteNode (char CharToDelete, NodePtr List, int &CharFound) { NodePtr NodeToBeDeleted; NodePtr Temp = List; if(List->Link == NULL) return; while(Temp->Link != NULL) { if(Temp -> Ch = CharToDelete) { NodeToBeDeleted = Temp->Link; Temp->Link = NodeToBeDeleted -> Link; delete NodeToBeDeleted; CharFound = 1; } else Temp = Temp->Link; } if(CharFound != …

Member Avatar for Clinton Portis
0
95
Member Avatar for skeet123

Almost got this program to work. Still have one error but not sure how to fix. It is using a linked list class for storing nodes. Here is the code: [CODE]// functions use by main void mergesort(linked_list& list); // Merges sorted list dl1 and dl2 into a sorted list dl …

Member Avatar for Noumi
0
142
Member Avatar for ab00120

Hi there, I am trying to make a program, as shown below. I have used a snippet with hello and bye as the program is really very big. Unfortunately I am unable to edit these functions as they are all part of a complex linked list. I am trying to …

Member Avatar for jonsca
0
96
Member Avatar for xavier666

[B]This is just a linked list program for those who need help understanding the fundamentals. Put comments if you find some bugs. The program is about maintaining a student database (their roll number and their age) I've used Turbo C++ 4.5 as the compiler[/B] :icon_cool:

Member Avatar for xavier666
3
210
Member Avatar for Jehutiy

Hello, I have this sort function that needs to be able to sort both strings and ints in a linked list. While the code I have does compile, It seems like it goes into an infinite loop and does not sort my elements. Can anyone see any problems or give …

Member Avatar for kvprajapati
0
101
Member Avatar for MooAndStuff

Hey guys, im having some trouble in finding what I should return with the [] operator overloading. Here is my implementation code: [CODE] template <typename L> L& List<L>::operator[](int index) throw (ListException) { if (index >= length || index < 0) { throw ("In function: operator[]: index >= length or < …

Member Avatar for jonsca
0
106
Member Avatar for MooAndStuff

Hey guys, first of all thanks for the time to even read this. Basically, Ive had some trouble in figuring out how to get this operator overloading to work. I think I'm having trouble in the functions calls that are within this function. These functions that are giving me trouble …

Member Avatar for MooAndStuff
0
108
Member Avatar for hussamo

[CODE][/CODE]// i need a linked list that can do those functions //-------->>> insert , delete ,search ,check if empty ,print <<<----------- // plzzzzzzzzzz i can't inderstanund //i did understand the insert functoin but the other not :'( [CODE]#include <iostream> using namespace std; class link { public: struct employee { int …

0
59
Member Avatar for iamsmooth

So I'm using an ArrayList (to create a hash table structure) like so: [CODE]protected ArrayList bucketArray;[/CODE] Later in the constructor, it initializes it as: [CODE]bucketArray = new ArrayList(500);[/CODE] When I use it and try to insert a Node from a linked list in like this: [CODE]bucketArray.add(357, nodeToBeInserted);[/CODE] it gives me …

Member Avatar for masijade
0
98
Member Avatar for vijaykalmani

Please help me on 1) C++ pgm to reverse a linked list 2) Given 2 lists L1 & L2, create a 3rd list which is intersection of L1 & L2 3) Given an infix evaluate it without converting it to postfix (hint use 2 stacks)

Member Avatar for vijaykalmani
-2
101
Member Avatar for gedas

hi guys im creating a dictionary which would show the word and the meaning of the word this is what i have done so far, i created a class called meaning which stores the meaning of the word [code] #ifndef MEANING #define MEANING #include<string> class Meaning { public: Meaning(); ~Meaning(); …

Member Avatar for power_computer
0
158
Member Avatar for power_computer

I have a linked list containing the following data struct node { string name; int hours; node* next; } I have all function I've made so far working, adding indiviual node, deleting node, printing data in nodes, Ive made the program to read from a file upon execution to create …

Member Avatar for power_computer
2
1K
Member Avatar for hla3mi

[CODE]#include <iostream> #include <string> using namespace std; struct Employee { //Data string name; int id; string residance; int salary; }; class Node { public: // Data Employee data; // The Next Pointer Node * next; // Constructor Node(Employee Object ,Node * ptr = NULL ); }; class List { int …

Member Avatar for hla3mi
0
198
Member Avatar for Vikings1201

I am trying to complete a circular linked list add method but I am having difficulty understanding how to. I wrote the above link list add method. I know that a circular linked list, somewhat. Here is what the add function is suppose to do: Any suggestion on how to …

0
55
Member Avatar for meaf

Hi , I'm a beggener in C# and i have an assignment about Linked List, i have been asked to do it in GUI . i managed to add the node and move around one to another, now i am suppose to update the node but really don't have clue …

Member Avatar for DdoubleD
0
96
Member Avatar for .11

Hey everyone... Well I am sorting items based upon a number. My first case is if tail == null, if so that the first element to be added in the list. My second case is if the element I want to add number is greater than the tail. If so …

Member Avatar for .11
0
130
Member Avatar for .:Pudge:.

I don't know how to properly override this function when it comes to an Iterator for a linked list. [CODE] ListIterator operator++(){ currentPtr->prev=currentPtr; currentPtr=currentPtr->next; currentPtr->next=currentPtr->next->next; return *this; } // advance iterator to the next list node; return value is iterator *after* advancing ListIterator operator--(){ currentPtr->next=currentPtr; currentPtr=currentPtr->prev; currentPtr->prev=currentPtr->prev->prev; return *this; } …

0
55
Member Avatar for tkud

Hey,everyone.. pls I need a very exhaustive example of a typical linked list for better understanding .Any help will be appreciated..Thanks

Member Avatar for tkud
0
106
Member Avatar for Jehutiy

Hello everyone, I am having some trouble trying to get my circularly linked list to work. It does compile but it gives a Segmentation fault. This is my first time learning something like this and I don't really know whats wrong. If anyone could possibly point out some problems it …

Member Avatar for MooAndStuff
0
129
Member Avatar for .:Pudge:.

*EDIT* IT IS A SEGMENTATION FAULT NOT BUS ERROR (anyway to change thread title?) I am trying to make a deep copy of a linked list, but whenever I run a test of the constructor i get a "Segmentation Fault". I tested the "Append" method and it works fine. I …

Member Avatar for power_computer
0
105

The End.