2,180 Topics

Member Avatar for
Member Avatar for fishsticks1907

Hello, I'm making a linked list and when i try to make a member function to return a new object i keep getting an error reading: "‘node’ does not name a type". I think im writing the function wrong, any help would great. #include <iostream> class list { private: class …

Member Avatar for fishsticks1907
0
165
Member Avatar for CodyM

Im getting errors that i don't understand how to fix, any help would be greatly appreciated! >C:\MinGW\bin\g++ -pedantic -Wall -Wextra A9COPY.cpp -o A9COPY.exe A9COPY.cpp:36: error: expected constructor, destructor, or type conversion before '*' token A9COPY.cpp:44: error: expected unqualified-id before "void" A9COPY.cpp:44: error: expected constructor, destructor, or type conversion before "void" …

Member Avatar for mrnutty
0
198
Member Avatar for BobA85

There is an unresolved external symbol in main.cpp when i try to call the insert function. I can’t find the reason why this is happening? Any help is appreciated. main.cpp #include "List.h" int main() { LList<int> number; number.Insert(1); } list.h #include <iostream> using namespace std; template <class T> class LList …

Member Avatar for acecode
0
359
Member Avatar for meetjatin88

#include <stdio.h> #include <ctype.h> #include <stdlib.h> #include<conio.h> #include<iostream> struct list { int data; struct list *next; }*L; //function declaration: void create(int data,struct list **head); void print(struct list **head); int main() { //list *L; int data =10; for(int i=0;i<3;i++) { //struct list *pList = NULL; create(data++,&L); print(&L); getch(); } } void …

Member Avatar for thendrluca
0
176
Member Avatar for adlinaalbert

please help me choose an title to do a package using **binary tree** or **multiply linked** list data structure....

Member Avatar for deceptikon
1
36
Member Avatar for nyfan68

I am suppose to write a program that inserts 25 random integers from 0 to 100 in order in a linked list. The program should calculate the sum of the elements and the floating-point average of the elements. I have been stuck with the add and average functions for some …

Member Avatar for Geli19
0
586
Member Avatar for amahmoud

I was wondering if anyone had a good implementation of a List of list. The reason is to create rows and columns sort of like a database or spreadsheet format. I would like to insert data into the list and print it in the format of Column Column Column Column …

Member Avatar for NormR1
0
170
Member Avatar for amahmoud

I am writing code in java to support a working database. What I mean by that is I will have linked list store the data(I plan to change later) and use a parser to break down sql statements in turn interacting with the linked list. The question I have is …

Member Avatar for NormR1
0
41
Member Avatar for tenorjazz

Hi, I'm trying to make a template page for my web site. The main template will include a header section, a main body section and a footer section (not included in sample code). I want to make the header and footer sections separate html pages so I only need to …

Member Avatar for code739
0
220
Member Avatar for coder91

There is code in the project I am working on that increments. Basically the user selects from a drop down list and than there is a button that increments the number for that option, to record how many times they've done something. Now I need to write code to decrement …

Member Avatar for bill_kearns
0
101
Member Avatar for firras

If someone could help point me in the right direction, it would be much appreciated. My problem is merge sorting a list from a text file and outputting the sort into a different text file that the user chooses. The text file that's inputted is about a 20 item list …

Member Avatar for Ancient Dragon
0
706
Member Avatar for sobias

Hi Guys, There's something bugging me in the past 2 days. In Doubly Linked Lists, when will a Node get comepletely deallocated? is it when both **Next** and **Previous** references points to **NULL**? forget about the class and the method **remove()** and such. Let me make an example so you …

Member Avatar for sobias
1
231
Member Avatar for jongiambi

Hi im writing a fill-in-the-blanks program and I am stuck on how to delete a node from a liked list. I am suppost to follow this psuedocode to finish the program. I think I am close to a solution, can anyone point out what im doing wrong? The list already …

Member Avatar for Ancient Dragon
0
282
Member Avatar for adesexy

hi . i need help.You are asked to implement a set of programs to simulate a group of users being logged onto a computer network. Users may be added, deleted, modified, displayed and searched for at any time. A method to test whether a user’s name is a palindrome (a …

Member Avatar for JamesCherrill
0
78
Member Avatar for alikhandro

how can i implement a polynomial class using the doubly linked list data structure such that each node of the list holds the coeffient and the exponent of the term ?

Member Avatar for NormR1
0
353
Member Avatar for coroshea

The prgram will only display one number. In this case 9. I switched, 9 with 6.71; and only 6.71 displayed. So what this means, only the 2nd to last node's value is displayed. Note that the display function is able to display the original order of the array passed to …

Member Avatar for coroshea
0
220
Member Avatar for alex910TN

Guys I have a quick general knowelege question. When defining a function in any programming langauge that will return a pointer to a linked list created in the function, can we return that pointer by reference? If so, can you provide me with a SIMPLE example of the following scenarios: …

Member Avatar for mrnutty
0
166
Member Avatar for coroshea

The program works perfectly. But in order for an individual to succeed in computer science, he or she must fiddle around with the program, and come up with other algorithms, such as converting a pre existing one, even it it is more or less efficient. Again the program works perfectly. …

Member Avatar for coroshea
0
211
Member Avatar for johndolby

What are the benefits of using LinkedIn for business? How can I get traffic from this social networking website?

Member Avatar for DavidB
0
114
Member Avatar for kw83028

Hello, this is my first post here so please let me know if I'm doing something wrong. I have a linked list project that I'm having a little trouble with. I was given LinkedList.cpp (main) and that can't be changed. I had to use a completed program that we did …

Member Avatar for kw83028
0
421
Member Avatar for CodyM

Trying to make my function that takes in an array and arrayLength and outputs a linked list equivalent to the array.Any help would be greatly appreciated! Node* array2List(int A[], int n) { Node* p; Node* q; q = NULL; for(int i = 0;i<n;i++) { p = new Node; p->val = …

Member Avatar for NathanOliver
0
110
Member Avatar for sarah.mathieson.7

I'm not sure if this is a duplicate question, so if it is, please feel free to direct me in the proper place, but I couldn't find an answer to my question. I am currently trying to switch from using an array to a linked list. (This is for an …

Member Avatar for Ancient Dragon
0
203
Member Avatar for coroshea

I chose to enter 4 months during runtime. I decided to test out the member functions/dynamic feature of linked lists, by then adding 3 months before compile time (static binding), which would be appear after the first 4 months. The program outputs: > Full list again: > Month January, had …

Member Avatar for coroshea
0
280
Member Avatar for rithish

just tell me will this sorting algorithm work out in linked list for(i=head;i!=null;i=i->next) for(j=i->next;j!=null;j=j->next) if(i->data>j->data) { temp=i->data; i->data=j->data; j->data=temp; }

Member Avatar for deceptikon
0
142
Member Avatar for jamesmadison43

The goal of the program is to make a sparse matrix using circularly linked lists. basically its a matix what only has values at the locations entered, and the rest of the lactions are not defined. the question i have is the logic for the code. how would i go …

Member Avatar for jalpesh_007
0
274
Member Avatar for RozenKristal

import java.util.*; public class List { public static INode head; public List() { head = new INode(8); } public static void main (String[] args) { INode a = new INode(8); int data = a.getValue(); System.out.println(data); System.out.println(head.getValue()); } } And my Node class: public class INode { private int value; private …

Member Avatar for jalpesh_007
0
226
Member Avatar for Hojjat.Mojallal

Hi I've tried the code below to merge 2 linked list which f1 and f2 are the first nodes in the initial lists and the "first" is the first node in the result list. But it doesn't work! [CODE] node *merge(node *first,node *f1, node *f2,int n1,int n2){ int n=n1+n2; while(n-- …

Member Avatar for mandeepsukhwinderparmar
0
4K
Member Avatar for dancks

I don't know jack about Visual Studio, and I'd like to keep it that way because I like doing stuff on the command line, I have my preferences. But my teacher uses it to compile and I'm curious what I did wrong because gcc didn't throw anything. So, code (Without …

Member Avatar for dancks
0
202
Member Avatar for liphoso

How would i go about declaring an array that has pointer to linked lists? i need to create an array that has 28 elements(28 letters of the English alphabet) of char type and each of them should be a pointer to a linked list that will store words. i am …

Member Avatar for Ancient Dragon
0
188
Member Avatar for Niketh

hi all, I am working on C++ coding of fault simulation algorithm of a digital circuit . The first step involves parsing of netlist files. The sample netlist looks like - # Only 2,3 input gates considered ... INPUT(1) INPUT(2) INPUT(3) INPUT(6) INPUT(7) OUTPUT(22) OUTPUT(23) # comment here 10 = …

Member Avatar for hactor
0
573
Member Avatar for dsotelo91

Hi there. I am trying to code a program to add or subtract two polynomials using linked lists. For ex. (+4x^2-2x^1) + (+2x^12-5x^5). So far I have a read function which takes in a string and uses substrings to take the coefficient and exponents and insert it to a node. …

Member Avatar for dsotelo91
0
4K
Member Avatar for testie

Im having some trouble putting together a linked list implementation of a queue. I'm getting a segmentation fault, which I believe is due to my empty() function because in an attempt to fix my empty() function, I made it determine empty based on (current_size == 0) instead of (front_p == …

Member Avatar for dx9_programmer
0
762
Member Avatar for TheNotoriousWMB

I'm trying to build a banking program with the capability to create new accounts (savings or checking), process a deposit, process a withdrawal, or print one or all of the accounts at this "bank". I am doing this utilizing two classes, one for 'Checking' and one for 'Savings'. I've more …

Member Avatar for Gonbe
0
284
Member Avatar for FUTURECompEng

Currently this method has a run time of O(N^2) and I am trying to get it to O(N). Any suggestion as to where I should start? public void removeAll(e removeNum) { node nodeToFind = this.find(removeNum); while(nodeToFind != null) { this.remove(nodeToFind); nodeToFind = this.find(removeNum); } } Thanks

Member Avatar for JamesCherrill
0
302
Member Avatar for kt9871

ran into a little snag with my code. i am trying to push the data of all the nodes in a linkedlist into a stack. problem is, i have no idea how to properly convert a node into a variable. Node current = list.returnHeadNode(); //other code... stack.push(current.getData()); my error lies …

Member Avatar for kt9871
0
432
Member Avatar for pattilupwned

Hello, I am writing a program that reads in data from a text file and puts it into a linked list. Certain variables are read in only if the "officeHeld" number is a particular number, otherwise the variable is set to 0. When I run this through Visual Studio, I …

Member Avatar for dx9_programmer
0
365
Member Avatar for FUTURECompEng

I am trying to input an int into the end of a singly linked list. I have already created the code to put a number at the end of the list but when I go to print it out, it only prints out (in my test class) the int that …

Member Avatar for jalpesh_007
0
307
Member Avatar for bguild

I want to create a word processor. It seems like a useful project because I have strong feelings about how modern big word processors like MS Word and Open Office don't do things right, so my solution is to make one with more modest features but with the huge advantage …

Member Avatar for mike_2000_17
0
1K
Member Avatar for taylor.mitchell.353

I took a different view with Delete States. I decided to implement it like the InsertAfter method by using a Boolean, but I am pretty sure I am doing it right, but it only displays one state after I implement it. My Code for the Delete /** * * @param …

Member Avatar for Taywin
0
162
Member Avatar for rithish

hii i finished these topics 1.linked list 2.stack and queues.how much time will it take me to finish trees 1.binary tee 2.avl tree 3.b-tree 4.binary search 5.threaded binary tree??? actualy ill try through linked list will it be easy???

Member Avatar for Gonbe
0
114
Member Avatar for rithish

hello im trying to delete a middle node in binary tree .but i have tried it in a linked list but here how to do that does any one them has links or video tutorials???????????

Member Avatar for Gonbe
0
143
Member Avatar for taylor.mitchell.353

I have to insert State objects into the link list, but the linklist is sorted I placed my notes in my code. Any help would be appreciated. public void insertAddStack() { int probe=0, index=0; States key=null; for (; index < addStackItems; index++) //loops through keys { for (; probe < …

Member Avatar for taylor.mitchell.353
0
333
Member Avatar for rithish

hii deceptiokn my question is we know we can implement a bubble sort in an array.Is it possible to implement bubble sort in circular doubly linked list?????

Member Avatar for Ancient Dragon
0
478
Member Avatar for ownedbynothing

I do have 2 structures here. main linked list is the word. each node of the word list do have a meaning typedef struct node{ char word[20]; struct node2 *meaning; struct node *next; }word; typedef struct node2{ char meaning[100]; struct node2 *next; }means; My problem now is I can't add …

Member Avatar for Gonbe
0
1K
Member Avatar for SAM2012

I have a queue class code is given below: struct ListNode { ListNode(int value); int value; ListNode* next; }; ListNode::ListNode(int value): value(value), next(nullptr) {} public class queue { public: queue(); ~queue(); bool Empty() const; int Next() const; void Enqueue(int value); void Dequeue(); void DisplayAll() const; int getP() const; private: // …

Member Avatar for SAM2012
0
288
Member Avatar for superchica08

How to display odd and even numbers from a queue link list? hello everyone i really need some help right now on this program. what this program is supposed to do is copy 11 22 44 77 33 99 66 into a linked list that behaves like a queue. the …

Member Avatar for chaau
0
4K
Member Avatar for songseungun

Hi. I'm having problems about my program. My program is something like a directory. It takes in values for different fields and stores it in a linked list in a sorted manner. It also allows the user to save the linked list contents to a text file. Everything runs okay …

Member Avatar for songseungun
0
871
Member Avatar for taylor.mitchell.353

I’m not sure why this isn’t working. Java isn’t giving me an error I have this in my StateController class public void insertLinks() { for(int index=0; //index is a local variable for state objects index < numStates; index++) //for loop to continue making state objects stopping at numStates(50) { myList.insertFirst(myStates[index]); …

Member Avatar for dimasalang
0
373
Member Avatar for rithish

hello iam trying a circular queue in linked list and array there are two questions for me 1.how can circular queue can be implemented in a normal linked list??i think it can be implemented in circular singly linked list right?? 2.if i implement it in array how i will connect …

Member Avatar for WaltP
0
141
Member Avatar for Brian_L

#include <iostream> using namespace std; class Lists{ public: void insert_head(int insert); void remove_head(); void insert_tail(int insert); void print(); Lists(); private: Node *head; Node *tail; }; struct Node{ int data; Node *link; }; int main() { Lists temp; temp.print(); return 0; system("PAUSE"); } Lists::Lists(){ head = new Node; head->Link=tail; tail->Link=NULL; } …

Member Avatar for JasonHippy
0
151

The End.