2,180 Topics
![]() | |
To any and everyone :) As stated in my title, this is a homework assignment, so I appreciate any help or suggestions that are given. Also, per the website rules, I have put effort to this, and I'm not asking anyone to just do my work. (The program compiles and … | |
Okay, so my program is very close to completion. The only problem is that the program leaks memory. The deleteNode, deleteManager, and destroyList are the ones to blame, or so I think. When I delete a node other than the first one it works while leaking memory. However, when I … | |
I am trying to create multiple trees after calling tree_holder. The number of tree is unknown until compile time. Since there are many trees, and i want to access them right away just like an array. I do not use linked list since it is too slow. I have written … | |
Ah right! Im on my first steps on c++, What Im trying to do is have this "basic node" class wich just take an id and from there usign inheritance make "linked list node" and "binary tree node" classes my code so far looks like this [CODE]void main() { sLink* … | |
This one's got me really confused, but hopefully y'all will see something I can't for lack of experience and expertise. The following segment of code is part of a larger function that performs a Hough Transform on a series of coordinates to find lines described by the points. I'm looking … | |
I'm having trouble with passing a linked list between functions. I did some research online and found a few things, one of which was here, that led to the conclusion that I am not passing my linked list by reference. However, I have tried numerous different syntaxes to do this, … | |
I'm having trouble making this program with linked lists work. Where I am having a problem is in printarea() [code] //**************************************************************** // This program tests creating dynamic linked list of // several Dynamic (descendents) // It uses: shape1.h header file // Filename: prtshape.cpp //**************************************************************** #include <iomanip> #include <iostream> #include "shape1.h" … | |
I'm trying to make a linked list, what's wrong with my syntax for adding a node? [code=c] struct data { char name[20]; char number[10]; }; typedef struct node { struct data list; struct node* next; } Node; Node *head = 0; Node *tail = 0; Node *New = 0; void … | |
Okay, I have to store an adjacency matrix for a graph problem I'm doing. Let's use this picture to explain it right now. [url=http://i21.photobucket.com/albums/b272/DemonGal711/Program%20Pic/pic.jpg]Click here[/url] I figured, I'm use a linked list to store it where each node uses the struct [code]struct Node { char item; Node* vertex; Node* next; … | |
this is a linked list assigment and the required from me is to fill the functions: i have one fucntion left that i was unable to do which is void DeleteElement(int ID); and i have another problem the compiler states that i hve o errors but when i compile the … | |
Hi guys. I'm having some right trouble at the moment. I posted on another tech forum and so far have received no help. So i thought i'd try over here. These are my posts from the other forum to get you up to speed with my problem. About a few … | |
hi everyone..i really need help as fast as possible..i have 14 errors in the program..it is a linked list implementation for reversing a stack using recursion.. here is the code: [CODE]#include <iostream> using std::cin; using std::cout; using std::endl; #include<cstdlib> #include <fstream> using std::ifstream; using std::ofstream; #include"ItemType.h" using namespace std; struct … | |
I am receiving the following compile errors: [CODE] BinarySearchTree.cpp:3: error: expected constructor, destructor, or type conversion before â<â token BinarySearchTree.cpp:9: error: expected initializer before â<â token BinarySearchTree.cpp:15: error: expected initializer before â<â token BinarySearchTree.cpp:21: error: expected initializer before â<â token [/CODE] Looking at my implementation, I fail to see the … | |
i am done with the main of the program but i have difficulty with several functions that need help if u please help me thank u very much #include <iostream> #include <string> using namespace std; void Output(struct Employee *data_ptr); void Input(struct Employee *data_ptr);void AddElement_Front(struct Employee E); void AddElement_End(struct Employee E); … | |
I have googled the error and found nothing. This is the last bug I've been trying to work out and the only I haven't been able to figure out. Thank you for your time. I'm currently trying to test out a standard simple linked list class. I'm currently trying to … | |
Generic Double Linked List [CODE="C++"]/* These are generic Functions for a Generic List * Note:-Only Functions not including a Menu and an Interface * You could use these Functions for your own Benefit*/ #include <iostream> using namespace std; template <class X> struct node{ //Template Structure X data; node* next; node* … | |
I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent … | |
Hello, I'm having a simple problem. For my program, each song has an id number which stores the songs information. For my deleteSong function, I am asking the user what id of the song does he/she wants to be deleted. After the user enters the id of the song he/she … | |
whenever the clearMemory function is called i get a segmentation fault and i can not figure out whats wrong. The function is supposed to delete all pointers. The function brings in the pointer to the linked list by reference. The nodes in the list are structs i named bus that … | |
I am creating a linked list which links a struct of data together. However, this is my problem, if I declare struct Node first then the Event type wont exist, but if I declare struct Event first then nodePtr wont exist....im kinda stuck here as to how I should declare … | |
Hey! We have to write a function that deletes nodes from a linked list. I was wondering if you could tell me if this is correct, and if not, how I could fix it? [CODE]void delNeg(node * L) { node *cur = L; node *prev = NULL; while(cur != NULL) … | |
I am trying to create a Space Invaders sort of game. I am using a linked list for the bullets that the player shoots and in the same list, there is also the enemies. I have a addNewEnemy Function which I run once in the main game loop. This adds … | |
Hi All, I'm actually making a little program but I'm encountering an error that I can't manage to resolve. So I have a linked list of "User" (each User has got a pointer to the previous User and another pointer to the next User). At First, the List is empty … | |
Hello. I am currently having problems. I am asking a user to input the position and number of where they would like to insert into the Linked List. After the user input the information, the number does not appear in the Linked List, but everything else does. Can someone help … | |
Hello. I'm having problems in 2 different functions: GetNth() and InsertNth() 1) For my GetNth() function, I want to take my linked list and an integer index and return the data value stored in the node at that index position. For example: {42,13,66}, the index of 1 should print out … | |
Main.cpp This is where the problem lies. [code] #include <iostream> #include <time.h> #include <math.h> #include <iomanip> #include "LinkedList.h" #include <fstream> #include <string> using namespace std; void main(void) { LinkedList Customers; Customer* newCustomer; Entry* test; int i = 0; newCustomer = new Customer(1001, "Olly", "07/10/1988", "17 Bob Lane", "Hobbs Road", "UB3 … | |
Hello. I'm having 2 difficulties... 1) I am trying to print out a string with spaces... Functions used: addSong and printSong For ex: (This is not the whole code...I'm pointing out the functions that it is used in) [CODE=Cplusplus] void addSong(mp3Type*& first, mp3Type*& last) { cout<<"Song title: "; cin>>songTitle; getline(cin,songTitle); … | |
"Write a program to display a linked list graphically. Draw each element of the list as a box, and indicate the links with line segments. Draw an iterator as in Figure 15-3. Supply buttons to move the iterator and to add and remove elements." The elements of the node appear … | |
Hello, I know how to create a hash_map and use my hash function with it, but I don't know how to handle collisions. Specifically, how would I implement a chain/buckets with a linked list... it seems like it's built in but I can't find how to do it. [code] #include … | |
Hello everyone, This is my first post, I'm having trouble on an assignment. I'm writing a function for a database program in class... I have to write the function that will tranverse a linked list, add a "node" and then write the user entered info into the "node". The first … | |
This is my goal: - Search the list for a number and display how many times the number occur or display 'number not present' - Modify number and change each occurrence of a #, to the new number or display 'number not present' I have 2 functions. My first function … | |
Hello, I'm in the middle of writing a doubly linked list, I have the print in reverse working fine and my insert function working fine, I just can't seem to find what I'm doing wrong with the delete function.. WHen i try to delete the last letter in the node.. … | |
Hello.. This is what my program is suppose to do: -find length of list -check for empty list -insert in back of list -delete from front of list [B]I have everything done except finding the length of list and check for empty list.[/B] I need help getting the length of … | |
Hi, can anyone help me fix my code. This program is linked to a project list (with classes). This is the main program. It has to open up a file of strings and output then in order of how many there are. But its not working though. Can someone help … | |
Hi does anyone knows how to sort in link list, i already done some parts of it and its already working except for the sorting part. please help me about this sorting problem... [CODE]#include <stdio.h> #include <stdlib.h> struct nodeTag { int nData; struct nodeTag *pLink; }; typedef struct nodeTag structNodeType; … | |
I can add a new node if the head is empty, but I can't attach a new node. Instead I get a null pointer error. Can anyone see what I'm doing wrong. I think I've been staring at this for too long. EDIT: Forgot to say I'm adding the Nodes … | |
I have a project where i am having to create a doubly link list of persons, with lastname, firstname, and id number. Basically, how do I implement my compareTo method in my add method of dbl list ??? thanks in advance. Here is my person class: [code=java] public class Person … | |
Hey all I've been writing a program that cheks an ISBN number as valid or invalid as an assignment for a class but I need a little bit of help. I get these errors when I try to compile it: error C2275: 'std::string' : illegal use of this type as … | |
Hi guys I am trying to implement a buddy system using C, I've free the memory using myfree() and i've allocated memory using mymalloc(). I've tried to run the program, but it keep on generating segmentation error, would you guys please see the code, and tell me if you've spotted … | |
HI i have a small problem but for some reason i can't think of how to do it. I'm making a linear linked list of arrays. The Array is of travel class object. So in the struct node, how should i implement so that the size of the array is … ![]() | |
[CODE=cplusplus]// CS 210 EDDIE CHEN // THIS IS PROGRAM 4 (ISBN-Check), a program that verifies ISBN. #include <iostream> #include <fstream> // REQUIRED FOR FILE STREAMS #include <cstdlib> // FOR DEFINITION OF EXIT_FAILURE #include <cctype> #include <string> using namespace std; // ASSOCIATE STREAMS WITH EXTERNAL FILE NAMES #define inFile "isbntest.txt" // … | |
Im having trouble turning this function into a recursion function, partly because I did it another way and now I cant think of how to do it recursively. Can you help? [CODE]int list::recursion(int item, int position) { node* temp = startPtr; while(temp != NULL) { if(temp->item == item) return position; … | |
Hi! I want to know if it is possible to display a binary tree using double linked list as follows: A / \ B C / \ / D E F I tried some possibilities but i think it is impossible since there are lots of parameters to take in … | |
Hi I'm new to coding. Can someone please help with a linked list problem. I'm getting numbers for output, I think they are addresses. The output I'm getting is: HEAD CODE -12086434400 1080131584 TAIL CODE The output I need is: HEAD CODE <rect x="0" y="0" width ="200" height="200" stroke-width="2" stroke="red" … | |
Write a program that implements an address book for your friends using linked lists. Each person has name, last name, and phone number. Data should be stored in ordered based on last name. The program should include the following menu: 1.Add a friend 2.Delete a friend 3.List all friends with … | |
Okay, I'm making a program that will let you traverse a maze where the beginning is the top right corner (coming from the right) and it ends in the bottom left corner (going to the right). We have a 2D array for the board and are using a stack to … | |
When I try to compile and run this file I get a segmentation fault when the size function is called so I must not have it set up right. The size function returns the number of stored chars in the queue. So I am thinking that the size function in … | |
Hi all. I am trying to overload the operator+ for a SLinkedList class I created. I would like to write [ICODE]list1 = list1 + list2;[/ICODE] and obtaining that list2 is merged into list1. I thought it was simple but it didn't worked properly. I tried to simplify the problem as … | |
how do you make a node of pointer of a device? (device is just a class that i made up, i need to use pointers in LL so i can "share" one object with multiple LLs) [code] struct node { device * devicePtr; node * left, * right, * next; … | |
Hi guys, By any chance do any of you guys know any way to implement an array of linked list without using vector, since i need to implement an array of linked list using c and unfortunately vector library is unavailable. This is what i did: [code] Struct MyList{ int … |
The End.