2,180 Topics

Member Avatar for
Member Avatar for dabbakal

Hello, am a new member and this is my first posting. Having benefited from lot of posting i decided to join. But currently am trying to solve an exercise and it is proven difficult for me. I have written a program in c++ in linked list but am facing two …

Member Avatar for John A
0
936
Member Avatar for alt234

I'm trying to write a recursive merge sort on a linked list. I'm basically stuck on the split portion of it currently. I came up with a solution quite similar to many other solutions I've found on the web. Many people say it works but so far my solution doesn't …

Member Avatar for thinkfast
0
121
Member Avatar for sbenware

I'm having a problem with my search function for my linked list. It has to do with my foodItem object. I'm not sure what to replace it with since it's part of the function protocol. The previous version of this [URL="http://www.daniweb.com/techtalkforums/thread72745.html#"]code[/URL] used an array and part of my problem is …

Member Avatar for nottoshabi
0
179
Member Avatar for fulyaoner

Hi to everyone... I am told to code a Schelling's Segregation Model simulation in C++ . This is about agent simulation and let me explain shortly what it is wanted: * There is a place like the chessboard (8*8) * there are 2 kind of people , the X and …

Member Avatar for fulyaoner
0
486
Member Avatar for sbenware

I'm having a problem with my search function for my linked list. It has to do with my foodItem object. I'm not sure what to replace it with since it's part of the function protocol. The previous version of this code used an array and part of my problem is …

Member Avatar for sbenware
0
472
Member Avatar for nnobakht

Hey guys, i jsut got this assignment and i have 1 week to implement it but i have no idea where to start. The link to the question is [URL="http://www.cs.sfu.ca/%7Emitchell/cmpt-126/a2/a2.pdf"]http://www.cs.sfu.ca/~mitchell/cmpt-126/a2/a2.pdf[/URL] and i have also attached it as a pdf. the Stack class refered to in the assignment is [code] class …

Member Avatar for jwenting
0
116
Member Avatar for notfornothing21

Hi -- I am writing a program taht is supposed to input 12 integers into a program, sort them as they are entered, and then Print out the Sorted list. Second step is compute the average. I have done all that. THIRD is to delete all the integers that are …

Member Avatar for WaltP
0
143
Member Avatar for kissiwat

Hi I've kinda hit an inspiration drought... Can anyone confirm that it is possible to return the value of several records within a linked list, add all the different values from each record, pass them as some sort of combined parameter into another file or record and be printed from …

Member Avatar for kissiwat
0
92
Member Avatar for dowen

{6,12,4,7,9} How do i write a method name serachMax that receives the list above (as an array of integer) as it's argument and return the largest value in the list and How do i create a method name countitem that receives that list above (as a referenced based linked list …

Member Avatar for MacGyver Orca
0
114
Member Avatar for notfornothing21

I am just learning linked lists and I need to start off my inputing integers and outputing them in a sorted list. I have written a code and pretty confident that the code make sense, but maybe it is out of sequence is why it is not working? I am …

Member Avatar for Infarction
0
192
Member Avatar for donaldunca

I have some problem with linked list FIFO(first in first out). This is my code: [CODE] typedef int datatype; typedef struct node *nodep; struct node *first,*last,*p; struct node { datatype data; nodep *next; }; void create(); void list(); void create() { char *tl; do { p=(struct node*)calloc(5,sizeof(struct node)); p->data=random(100); p->next=NULL; …

Member Avatar for mathematician
0
290
Member Avatar for donaldunca

I'm learning linked list. I have a question: How can I connect 2 linked list ? Thank you!:)

Member Avatar for Narue
0
106
Member Avatar for Robert S

Hi, I am trying to deploy an Access database application that refers to a dll in VB code using a DECLARE statement. I wrote the dll in using VC++ 2005. I have tested the dll and it really does work fine, on some systems. The application runs on one computer …

0
94
Member Avatar for MattEvans

Relevant header definitions are as: [code] class XMLChain { private: Segment root; std::vector<XMLOpen*> chain; Segment * immediate; std::vector<XMLOpen> openers; [/code] The function in question is: [code] void XMLChain::open(std::string tag) { Segment * last_immediate = immediate; openers.push_back( XMLOpen ( tag ) ); XMLOpen * cast_immediate = &(openers.back()); (*last_immediate).setNext( cast_immediate ); immediate …

Member Avatar for MattEvans
0
105
Member Avatar for Woeb

Hello, I'm still very new to C++ and have encountered some trouble in understanding how exactly the copy constructor for a stack class (given as an example in the book I've been learning from) using a linked list works. The interface for the classes: [code=c] template<class T> class Node { …

Member Avatar for Woeb
0
295
Member Avatar for sam_22

Hi everybody I am a beginner with C++ programming. And I need some help. How can I start with this program *********** [IMG]http://www.gidforums.com/images/gid/smilies/icon_smile.gif[/IMG] The program is using a text file of information as the source of the questions. The program starts by outputting a simple text information screen: Question Master …

Member Avatar for John A
0
216
Member Avatar for DynamitMsk

Hi everyone, I've been working on this for days, but just can't get it. I have a linked-list containing edges of a weighted directed graph, and my goal is to find a path from vertex A to vertex B going through exactly n nodes. Anyone has suggestions, or links with …

Member Avatar for DynamitMsk
0
117
Member Avatar for Metsfan147

I'm trying to figure out implementing the clone() method of Object. I have a class with a few data memebers that I thought I'd try it out on - a node class for a linked list. So, here's the class: [code] public class HashListNode implements Cloneable { private String data; …

Member Avatar for Metsfan147
0
116
Member Avatar for ThirdEye866

Hello all...this is my first visit to this site.... anywayz i really need help in this...it's stupid maybe...but am not really into c++ ....anwayz this is a linked list...i just need a function to print a certain node.. like print(0); which prints the data in node 0..... here is the …

Member Avatar for Ancient Dragon
0
196
Member Avatar for degamer106

I've been asked to create a movie data baseusing a hash table (w/ linked-list collision resolution) and a BST. Both of them contain a field that points a given structure (we'll call it *pMovie and its of type MOVIE) in memory. For example, if i'm going to insert "The Matrix" …

Member Avatar for Narue
0
137
Member Avatar for swathi.s

ive written a code in c for implementation of a lexical anlayser n when run in linux fedora 4.0 i get a segmentation fault. What could be the reason?? i ve implemented using singly linked list.. is this error coz of d malloc function...dynamic allocation??

Member Avatar for jbennet
0
28
Member Avatar for TylerSBreton

This block of code will compile, but gives me a runtime error: before the first comment is a header that is included in the file that you may need to analyze my code. [code= c] typedef char *string; typedef struct { string fieldName; string value; }oneField; /* this starts the …

Member Avatar for TylerSBreton
0
5K
Member Avatar for wasimraza

]i am entering some fields in a jsp page and storing it in a session bean.how do i store this information in the form of a linked list so that when i go back to the previous page and enter sme other values for the field ,it should be appended …

Member Avatar for jwenting
0
24
Member Avatar for dabobrow

I have a C++ program that reads from an infile, determines by a char if the line should be Deleted or Added. From there the program uses pointers to insert data into a sorted list. The issue I am having is printing the data out properly If you notice, I …

Member Avatar for dabobrow
0
189
Member Avatar for jess_redrose

Hi everyone, I've worked on this thing for about three days now and am really getting frustrated. I need to make a stack using linear linked lists of arrays. I've got my class to compile without complaining, but am really struggling with the function definitons of push and peek. Any …

Member Avatar for Ancient Dragon
0
121
Member Avatar for noxee

Hi I'm trying to have an assignment operator for my linked list class so that when I call it, it replaces the current one with the one I pass in. i.e testList1 = testList2; I'm trying to get it so that testList1 will point to testList2. Here is the code …

Member Avatar for noxee
0
78
Member Avatar for noxee

I'm having a problem inserting data into my binary search tree, it will insert some of it but not all. this is the header file for my BST class: [code=c++] #ifndef BST_H #define BST_H //----------------------------------------------------------------------------------------- #include <string> #include "LinkedList.h" //----------------------------------------------------------------------------------------- using namespace std; //----------------------------------------------------------------------------------------- class BST { public: //Default constructor, …

Member Avatar for noxee
0
128
Member Avatar for orko

Hello, I usually don't complain too much. But this time I am getting mad. I just wrote a linked list, where 1. If the value was not present before in the list, it will be added. In this case, there is a capacity. If the new value increases the list …

Member Avatar for Lerner
0
131
Member Avatar for tirivamwe

the function first search a word from the linked list. if found it then increment the numWords (number of words in listfor that word) and if not found it shoud create a new node for the word. the code is: [CODE]void AddWords( char text[30]) { check=head; while (check!=NULL) { if …

Member Avatar for Nick Evan
0
130
Member Avatar for nono909

Hello, i'm trying to write in the main program a linked list of namesfractions, and integres. i don't know if anyone can help me in this. i attached the fraction class and the implementationUsing the linked list class we derived in class, and the following functionality:[LIST] [*]A print function (you …

Member Avatar for iamthwee
0
87
Member Avatar for tirivamwe

i have this line of code and want to compare the word from the linked list with the one supplied by user. the code is: [CODE] if (strcmp(p->word,word)==0)[/CODE] and i am having this error: [COLOR="Red"]passing `char' to argument 2 of `strcmp(const char *, const char *)' lacks a cast[/COLOR]

Member Avatar for tirivamwe
0
589
Member Avatar for tirivamwe

can someone please help me to write a code in c to do the following: 1)read words from a file 2)store the words in a linked list 3)read the words and display 4)count the number of words in list

Member Avatar for tirivamwe
0
129
Member Avatar for mitchelltab

I'm having trouble calling my linked list of Insernode. Can some one help me please. I need ot call it when it read teh data from teh file and puts it in the lists. I also need to use the list once i eneter in there data. adn if i …

Member Avatar for Lucanio
0
133
Member Avatar for dhaya

i need a program urgently for round robin schedulng algorithm using circular linked list implementation.. please send a program using c++... post the prg to my mail id.. << moderator edit: removed email address >>

Member Avatar for Paul.Esson
0
1K
Member Avatar for vbcielle

i want to add all the inserted linked list by using this code but what happens here if i input 15 then 35 =50 but when i input again 30 the sum is 50whats wrong with my code? [CODE] int sum(nd **head){ nd *p,*sum1; p=*head; sum1=0; while(p!=NULL) { sum1->x=p->x; p=p->next; …

Member Avatar for vbcielle
0
152
Member Avatar for meriem

Hi everyone, Can You please help me with the [B]Round-Robin scheduler [/B] [B]algorithm (C language)[/B] My program will use as a Datastructure a doubly linked list to hold processes( I will represent my process as: Id(char*), Priority(int) ( a process with priority n will have n CPU time slots) and …

Member Avatar for ~s.o.s~
1
353
Member Avatar for Line

Hey! I'm looking for some help on what I'm doing wrong as I'm new to C#. I'd really like it if you can explain why my code isn't working and then offer some help on how to fix it without "making it easy" for me ;o) I have to understand …

Member Avatar for Tekmaven
1
571
Member Avatar for codeme

hey guys I have to write this program and I really suck at it.:sad: I need a doubly linked list which is ordered. I was told that I can pull one off the internet and just use it. Ive been looking for one but I cant find it, so I …

Member Avatar for ~s.o.s~
1
169
Member Avatar for happy8899
Member Avatar for happy8899
0
2K
Member Avatar for ScottishWarrior

Hi there. ive been making a program to display inofrmation from a .txt file, then display this data into a linked list. here is the code [code] import java.io.*; public class LinkListTest { protected static LinkList linkList; // Read the records from txt file into an array. static void readFromFile …

0
35
Member Avatar for dev.cplusplus

:mrgreen: Hi to all, I have a challange in my work, we have a project that uses a variable of type "CMapStringToPtr", this object is use to store some data, now we want to change the type to more efective type, the problem is that we need to know if …

Member Avatar for Laiq Ahmed
0
459
Member Avatar for Ginner

Hi all, I am working on a problem that should have been very trivial but has turned into a multiple marathon without an end in sight. I have written two very small scripts, one auxiliary script as below with two classes 'Node' and 'Queue' intended for use in a linked …

Member Avatar for N317V
0
258
Member Avatar for comwizz

hi , I just was trying to implement a stack using doubly linked list . Well , i cannot exactly find out the error. Any hint would be of great help. Heres the code [code] #include<iostream.h> #include<conio.h> class abc { public: int num; abc* next; abc* previous; friend void push(abc*,int); …

Member Avatar for Lerner
0
4K
Member Avatar for dilip.mathews

Hi all, What is the effficient way to check whether a single linked list is looped somewhere.The number of nodes in the list is not known. In that case traversal of SLL will go into an infinite loop. One solution I have is to store each address of node in …

Member Avatar for dilip.mathews
0
95
Member Avatar for joydeep1

I am trying to prepare a database using C,which can store data and from which data can be retrieved and edited. [B]First storing,then retrieving data from the file works.But,during first run of the prog if choice#2(i.e.,DISPLAY)is entered without entering any data using choice#1(although the file contains data),then error occurs,gets hung.A …

Member Avatar for joydeep1
0
106
Member Avatar for jqk

Hi, I came across your website, and I must say, Im really impressed, with what you people have to share ... I've got a question .. I'm starting my university on september '06 hopefully, and my major is going to be Computer Science. I have doubts lately, on what to …

Member Avatar for jqk
0
135
Member Avatar for thehakan

Hello; I have little experience in c++ and I should implement insertion sort algorithm using linked list. I wrote a working code however I should have use friends for having the list elements from a seperate class and use templates for sorting arbitrary data elements. Can anybody help me how …

Member Avatar for thehakan
0
149
Member Avatar for Nedals

This is a snippet from a larger block of code. The print statements are included for testing. Within 'main', if I ouput the 'cell_ptr' or 'params' pointers, it correctly returns pointer values but if I try to output an element from the params array, I get an '...illegal operation...' message. …

Member Avatar for Nedals
0
115
Member Avatar for codergem

Helo friends!! I m having problems in understanding that how every node is added at last.Could anyone explain me this in much better manner. Well here it is.... we use a local "reference pointer" which always points to the last pointer in the list instead of to the last node. …

Member Avatar for Lerner
0
175
Member Avatar for static

HI , i have some errors about linked list,when i made print it only shows characeters like 'ô¼'... plz help; :lol: // lets assume wordCount is 10 and vayArray is {"lower",upper}; :cool: Thank you very much Here is code:[code] struct for_char_5 { char vh5[80]; for_char_5 *next; }; for_char_5 *p, *start, …

Member Avatar for Ancient Dragon
0
131

The End.