2,180 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
{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 … | |
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 … | |
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; … | |
I'm learning linked list. I have a question: How can I connect 2 linked list ? Thank you!:) | |
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 … | |
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 … | |
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 { … | |
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 … | |
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 … | |
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; … | |
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 … | |
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" … | |
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?? | |
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 … | |
]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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … ![]() | |
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] | |
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 | |
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 … | |
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 >> | |
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; … | |
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 … | |
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 … | |
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 … | |
i wan to know the code for the radix sort using a queue and a radix sort using a linked list | |
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 … | |
: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 … | |
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 … | |
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); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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. … | |
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, … |
The End.