285 Topics

Member Avatar for
Member Avatar for TinhornAdeniyi

i am trying to move the node in the first item from the list and add it to the back of the list 1->2->3 becames 2->3->1 instead i get 3 1 2 [CODE] #include <iostream> using namespace std; struct nodeType { int info; nodeType *link; }; void createList(nodeType*& first, nodeType*& …

Member Avatar for TinhornAdeniyi
0
197
Member Avatar for AnkitPasi

Hello. The problem with the following code is that when I read from a file after restarting the program and then try to display the contents, it goes into an endless loop. I hope that someone can point out the logical error hiding there. [CODE]#include <iostream> #include <windows.h> #include <fstream> …

Member Avatar for thelamb
0
323
Member Avatar for sairakhalid

[CODE] #include<iostream> #include<time.h> #include<conio.h> using namespace std; class adclist { struct list { int data; list* next; }; public: void makelist(); }; void adclist::makelist() { list** table = new list* [10]; for(int j =0; j < 10 ; j++) table[j] = NULL; for ( int m =0; m < 10; …

Member Avatar for sairakhalid
0
150
Member Avatar for ambageo

Hi! I've got this structure struct *cell{int row,int column,int distance, struct cell *next}. By calling a function, I fill a linked list . The problem is that I cannot find how to delete the nodes that have the same row and column.Let me provide an example. Let's say that the …

Member Avatar for ambageo
0
188
Member Avatar for cuckas

Dear friends, hello to you all as this is my first thread - question to the forum. This is my problem, which is a school exersize: I create a linked list which contains three numbers r,c,d per node From this list I have to create a hash table htable[7] with …

Member Avatar for ambageo
0
331
Member Avatar for J0shu

Hello everyone. I've been trying to implement a linked list in C++. I found this implementation on the web, where they created a struct for the list's nodes. When trying to add a new node to the list, I get this error: [B]List.C: In member function `bool Linked::addNode(Point)': List.C:23: error: …

Member Avatar for jonsca
0
532
Member Avatar for htowa

hi I have been working in this code for a while and I need to know what's wrong with it ASAP. here: [CODE]#include<iostream> using namespace std; class Node { public: int value; Node * next; Node(); Node(int); }; Node::Node():value(0),next(NULL){} Node::Node(int v):value(v),next(NULL){} bool AllPositive(next * h) { bool test = false; …

Member Avatar for frogboy77
0
150
Member Avatar for muffle

Here is the input.txt file that I have. [code]2 5 -2 3 1 2 4 0 1 2 1 0 [/code] These are 2 polynominals. 2x^5 - 2x^3 + x^2 + 4 and x^2 + 1 while <3,5> : 3 is the coefficient, 5 is the degree. I just can …

Member Avatar for muffle
0
182
Member Avatar for xxunknown321

I believe the error has something to do with my mergeArray function. Its a modified version of the insertNode function. i tried to make it so that i can loop through and insert an entire array of elements into a linkedList. My program compiles without error but gives me a …

Member Avatar for xxunknown321
0
171
Member Avatar for peterwalter

THis is what I need to do...I need help with the third point [INDENT]1. Write a class OrderedList. The implementation of OrderedList must be as a linked list of Comparable elements. The list items are maintained in ascending order at all times. On this assignment, no indexing methods are allowed. …

Member Avatar for helpmehelpme
0
251
Member Avatar for jasleen12345

pls someone give me a c++ program to insert and delete an element from a linked list...i tried a lot but i am stuck..

Member Avatar for alaa sam
0
97
Member Avatar for TinhornAdeniyi

This is supposed to be a code for a video game store [CODE]#include<iostream> #include<fstream> using namespace std; ifstream infile; struct VideoGame { string Name; string Genre; string Publisher; string Developer; string Platform; string Price; int count; VideoGame *link; }; void CreateList(VideoGame*& first, VideoGame*& last); void CheckOut(VideoGame*& first, string title); bool …

Member Avatar for TinhornAdeniyi
0
223
Member Avatar for TinhornAdeniyi
Member Avatar for CLina

Hello everybody! I have to Questions to ask please: 1) How can I find the maximum value in a single linked-list recursively? this is what I tried to do: int findMax(int key){ Node max=head; while (max != null){ if (max < max.getKey()) return(max.getNext()); } } it ends up to an …

Member Avatar for CLina
0
5K
Member Avatar for insanely_sane

Been working on this for 2 hours non stop. Can't seem to figure out exactly what's the problem. Perhaps I'm taking a wrong approach to this problem. Right, I need to copy a singly linked list to another new list. Can use any method EXCEPT RECURSION. Here's the code so …

Member Avatar for Taywin
0
3K
Member Avatar for sairakhalid

How can i make addition in my linked lists if the nodes are stroing two values: 1) int element 2) int colomnvalue i have to make the addition on the basis that the nodes having the same colomvalue, thier element should be added. This addition is to be made in …

Member Avatar for Taywin
0
162
Member Avatar for sairakhalid

i want to know whats the error over here. i just want to store the three value in a node and making a linked list but after storing two nodes that is headptr and than temptr, when the third node is made it stops. I think my error is somewhere …

Member Avatar for sairakhalid
0
171
Member Avatar for hamza123

My question is that what is the effect if I delete a pointer in a linked list by mistake??? What problems will arise and how will I come to know that is a missing pointer that is causing the trouble?

Member Avatar for hamza123
0
94
Member Avatar for kdott

I've got a program that is supposed to mimic a music playlist by implementing a circular, doubly linked list. However, i cant use java's LinkedList, i have to write my own linked list. I have a DblListnode class to keep track of the nodes (show below) [CODE]public class DblListnode { …

0
121
Member Avatar for ehsantl

Hi guys I'm struggling to write a code for traversing a directed graph. It contains City as nodes. I'm trying to put City(s) to a LinkedList and then work with them to find the path. However, as you will notice I'm still newbie in C++. I have a *nextcities as …

Member Avatar for alwaysLearning0
0
135
Member Avatar for Knome

I've searched all over google and this site. I've found a few hints here and there but after i make the changes either my compiler throws a fit or it doesn't produce the desired results. Here's what i want: I want to create a linked list in the main function …

Member Avatar for Martin B
0
4K
Member Avatar for krazyito65

[code] class Node { private: int integer; Node *pointer; public: Node(int x = 0, Node *y = NULL) { integer = x; pointer = y; } int getInteger() { return integer; } Node getPointer() { return *pointer; } }; [/code] [code] private: Node *stack; Node *top; int listSize; int pushedValue; …

Member Avatar for krazyito65
0
217
Member Avatar for zhuangdeyouxian

[CODE]/*Task: Two ordered linklist contain number. eg.1->2->3-> and 2->3->5 **Print** union of them eg.1->2->3->5 ,remove duplication, can't change linklist Problem : 1. append() might need to be modified. 2. dnot't know how to use append() to complete the task. */ #include <stdio.h> #include <malloc.h> #include <string.h> #include <stdlib.h> typedef struct …

Member Avatar for Martin B
0
123
Member Avatar for ilkeamasya

I have an win32 console phonebook application. Phone records are held as linked list. [CODE] struct Tel_dugum{ char name[NAMELEN]; char telno[TELNOLEN]; Tel_dugum *next; }; [/CODE] You can see the structure of the linked list above. My problem is when i search i dont want my app to search whole records …

Member Avatar for vijayan121
0
116
Member Avatar for corby

Here are my questionsand my answers. Could you guys/gals tell me if i am right or wrong? Which array-based operations are O(1)? inserting item or deleting item in unsorted array Which linked-list operations are O(1)? inserting and deleteing item in unsorted lsit Which array-based operations are O(n)? traversing through the …

Member Avatar for corby
0
98
Member Avatar for girlzone

Hello all, I have a question: What are the advantages & disadvantages of the circular linked list compared with: a. Usual linked list b. Doubled linked list Although the implementation of the usual list functions & the circular list functions are similar…when do we have to use it?? or in …

Member Avatar for Martin B
0
442
Member Avatar for kdott

hi all, i have a programming assignment where i read a text file through command line arguments. i then use that information to get a list of photos (just strings, not actual images) and a list of keywords that correspond to each of those photos. i am stuck on how …

Member Avatar for JamesCherrill
0
156
Member Avatar for corby

Hey guys/gals for some reason in my main function my first while loop will not take in more than two values. any reasons why that wont happen? and just to be on the safe side, did I implement my remove function properly? [CODE]#ifndef SORTEDLIST_H #define SORTEDLIST_H #include<iostream> using namespace std; …

Member Avatar for prvnkmr194
0
157
Member Avatar for kdott

I have a scenario where i am given a file that contains info such as: (just a sample) img01.jpg|Washington DC|aquarium|puffer fish|seahorse img02.jpg|CHICAGO|AQUARIUM img03.jpg|Chicago|fish where the first section is the "image" (just a made-up name, not an actual image) and the rest of the words are keywords. ive been able to …

Member Avatar for NormR1
0
161
Member Avatar for bflack

Cn anybody give me a program about adding nodes at the end of the list in C? I just need a basis of a program that I will be creating. I also needed its algorithm. Thanks in advance.

Member Avatar for N1GHTS
0
243

The End.