2,180 Topics
![]() | |
// Linked list Hi... Below is the codes that I wrote so far... everything is fine but just abit headache on when trying to read the data from the file...and it give me a weird things... my output suppose is like this [CODE]============================================================== No Name/Site Location Weight 01 ThunderStone Russia … | |
I've got a project that requires the user to input a capacitor's ID and its corresponding capacitance. The user can add the capacitor at the beginning or end of the list. But, I'm having trouble figuring out how to put it at the end of the list. [CODE] while( currentPtr … | |
im getting the error below and I can't figure out why this isn't working. Ive looked at this for 2 days not knowing. I'm hoping a fresh set of eyes on it might help. main.c:13: warning: assignment makes pointer from integer without a cast [CODE] //HEADER FILE: #include <stdlib.h> #include … | |
I'm having problems with my code all over. I have to be able to open a command line argument( which i know how to do). create a linked list, and print it backwards. This is what i have but im stuck with errors that i don't know how to fix. … | |
Hello all, I'm having a bit of trouble logically figuring out what to do in this case for my cs150 class. I have to create a linked list from a while loop, but I can't figure out how to link the list successively at the end of each line so … | |
Hello, I need to sort the following by ID as I enter them into a linked list by while loop. So far I can build through the list, but I'm not sure how to sort by ID as they are entered: Albert 1000 55.5 150 Babs 3000 60 110 Freida … | |
Hello I have a question regarding linked list: The assignment I was given was rather large so I'm not going to go into the full details of what exactly it does and give you just what is needed to answer the question. First we have a student records structure [CODE]typedef … | |
Hi guys, I am implementing a singly linked list. The thing is whenever my str_temp goes above 12-15 elements, i get this error malloc: *** error for object 0x1099008b8: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug … | |
I want to fill a Drop-downlist with a list look heres my list code [CODE] public List ListaEmpresas(){ SessionFactory factory = HibernateUtil.getSessionFactory(); Session session = factory.openSession(); Transaction transaction = null; transaction = session.beginTransaction(); Criteria crit = session.createCriteria(Empresas.class); List empresas = crit.list(); List list = new LinkedList(); // Doubly-linked list list … | |
Hi all, I'm having a problem here!! I've attended a lecture on Implementation of stacks in c++ using arrays and it wasn't really hard to understand, but now I'm supposed to know how to Implement a stack using linked list, that's the problem. help please?:confused: | |
/* I write this pro in single linked list useing stuck how i convert it to class.. #include <cstdlib> #include <iostream> #include <string> #include <sstream> using namespace std; struct studentinfo { string FName; string LName; int no; int age; struct studentinfo *next; } *head=NULL; void add_studentinfo(int s); void print_list(); int … | |
I'm new to programming and C++. I've managed to succesfully insert multiple nodes from front. Problem is that when printing it starts with the latest node and goes "backwards". I would like it to start with the first node and print forward. Therefore I would like to insert new nodes … | |
Having issues creating table using chain hashing (linked nodes). The program compiles, but is crashing during execution. I admit I don't really know what I'm doing since I havent really used inked lists in forever. A lot of this code I do not expect to work right away, such as … | |
This is the only part of my assignment that has problem. Can anyone tell me what's wrong? I debug it, it shows me NullPointerException... please give me a hint, i urgently need this to be done. Its due today. So, I am supposed to write a method captured that will … | |
[CODE]public Node<E> remove (int index)[/CODE] i need to recursively implement this method. Node<E> nodes contain two fields, next (a reference to the next node in the linked list) and element (a reference to the data it contains) [CODE]public E element; public Node<E> next;[/CODE] Do not worry about the checking for … | |
Hello ; I need a help in my home work , I have to write the program that prints the number of clock ticks it took the program to sort the data the main part is already given , I have to wright the functions this is my program :: … | |
how to delete a node...u just have a pointer to tat random node ...no head node info... | |
The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set … | |
[CODE]#include<iostream> #include<string> #include<conio.h> using namespace std; struct node{ int num,ages; string name,skills; struct node *link; }; typedef struct node *nodepointer; nodepointer add(nodepointer &head, int nu, int age); void str(nodepointer &head, string na, string ski); void DeleteFront(nodepointer &head); void display(nodepointer head); int main(){ nodepointer head = NULL; int c,nu,age; string na,ski; … | |
Searching a circular linked list: Give a procedure in C, say ‘searchcircular (list,x) where the search stops when every element in the list has already been visited and the next node pointer points again to the first node that was earlier visited. | |
Hello, I've received an homework assignment to create an array via linked list. All went well until the compilation part where i get continuous errors. Seems most of the problem is that certain classes (DSA_array) doesn't recognize the existence of other classes and their member functions (DSA_list). Here's my code … | |
I just finished a site that list three zip codes as a service area. when the site is viewed in smart phone browsers the three zip codes become linked to Google maps or it tries to offer the zip as a call now phone feature. when the wrong zip is … | |
Hi I am doing an assignment and my professor gave us the code for a copy function for a doubly linked list. The function should copy list into another empty list and if the list being copied is empty it should just return and exit. Here is the code my … | |
Hello all, I have created an array of linked lists called hash_array[]. I am trying to write a search function. I am getting compiler errors on line 7 & 9. They are below. Line 7 warning C4018: '<' : signed/unsigned mismatch Line 9 error C2784: 'bool std::operator ==(const std::list<_Ty,_Ax> &,const … | |
[COLOR="Red"]hello.... I'm new member and I'm so happy that i found daniweb.com to get some help from you my friends.... i need help in solving this problem...[/COLOR] •Select one program of your choice that implements Single or Double Linked List in C++. Make sure you use class in your program, … | |
can anyone help me get an idea on how to add or subtract numbers in linked list for example i input the number 1,3,5 in order the display will 135 then i input the plus sign(+) then the input will 45 it will always add the 1st and 2nd number … | |
I have a simple doubly linked list for a class I am in and I keep getting a seg fault on my last line of code, no matter what i make it. I can put a bunch of random couts and it will print them all then on the last … | |
HELLO! There is no error and it runs, but it doesn't show my desired output. What is the problem? [CODE]#include<stdio.h> #include<stdlib.h> struct list { int data; struct list *ptr; }; int main() { struct list *clist; struct list *top; struct list *tmpptr; int i; clist=(struct list *)malloc(sizeof(struct list *)); top=clist; … | |
I have this assignment to do. Its been about a year since I messed with c++ and I've been refreshing my brain on the subject. The assignment is this : Your assignment is to write a program for a computer dating service. Each client gives you his or her name, … ![]() | |
How does the functions for creating nodes can be used to create a linear linked list with n nodes? The linear linked list that will be created will be assigned values from 1 to n, right? The newly created linear linked list is returned by the function create linear() below. … | |
AOA Dear fellows i have code in which i uses linked list.when i compile that program the compiled file run but not work. I write this code in Dev c++. [CODE] #include <iostream.h> #include <string.h> #include <stdlib.h> using namespace std; class Node { public: int value; string Name; Node * … | |
Hey Guys, I am really trying to get into List-Implementation. Everything I wrote works fine except the "delete Element at Position" funktion. With the iterative Implementation there is no problem, everything works, but I want to do a recursive Version. This is the Task: Invent an algorithm which becomes a … | |
I am implementing Selection sort in doubly - linked list. I have to sort list by surnames by finding smallest element and inserting it into beginning of the list But there are some troubles when I run my program I have NIL exception in Sort Method in while loop. Help … | |
Write a program that tells you if the expression entered is a tautology or not. Assume that you have no more than three propositional symbols in your expressions -- call them P, Q, R. You must use the linked list implementation of the data structures needed. The above is my … | |
Hi, this is what i'm trying to do [icode] class a { private: string attribute; string p_msg; public: string& getAttribute() { return attribute; } }; [/icode] above is the class, i want to call function getAttribute() from class a is a linked list: list<a*> aa [icode] void sortFile(Manager& manage, const … | |
i'm beginner in C++, please help me in display function to display the linked list of my following program thanks [CODE] #include <iostream> using namespace std; template< class T > class Lnode { public: T data; Lnode< T > *next; }; template< class T > class List { public: int … | |
I am trying to make a program to add, delete, and print a sorted linked list. I have tried many different things and now I am getting a Segmentation Fault so I was wondering what I am doing wrong? Here is my code so far: [CODE]//ItemType.cxx #include "ItemType.h" ItemType::ItemType() { … | |
Hello All, I am having a problem making my program display and output correctly. When i run my program my count will display but my word will just give me some kind of line. Can you please help me correct this? Thanks Ronnie [CODE] #include <iostream> #include <string> #include <iomanip> … | |
SO YEH MY problem is its not reading the whole file and inputing it to the stucture.. i believe that the problem lies in the adt.( the last source code on the bottom) in the private adt search function, insert function, and traversal..... ive been wreking my brains out trying … | |
SO im trying to get this source code transformed to a double link list it has two nodes sentinel and header....the source code was used to be a singly linked list..... nyhow i cant seeem to get this whole thing right..... it works fine when it was on its orginal … | |
Hi, I am a newbie to coding. I am trying to implement a graph in the following format. User input: v1 v2 edge_cost 1 3 10 1 2 20 2 3 40 3 1 30 I am storing the graph as an adjacency list, so that the output should be … | |
Please Help me I can't start with this project ! Implement a city 'database' using unordered lists. Each record contains the name of the city (a character string of variable length), the mayor of the city and the co:ordinates of the city as integer x and y, Your system should … | |
Hi, Can anyone show me or point toward a link with a decent example of a hash table using linked list. Thank you , | |
I am currently working on a project where we must read in a file and then print it back type justified. There must also be a specific number of characters per line based upon user Input with the extra characters being distributed spaces. I am reading in each character from … | |
Hi, I am trying to work on creating a linked list of player in a game, but I have not written code in a while and have no idea what I am doing wrong, can you please help with suggestion of what I did wrong or idea of how can … ![]() | |
i have this code for adding a node after the previous node, but valgrind is saying that there is a memory leak of 16 bytes, can someone please help me identify where the leak is? i think i didnt assign a null pointer somewhere but im not sure exactly where … | |
I'm new to generic programming and I just cant figure out what is wrong in this . The program is supposed to make a linked list using class. I have used 2 classes so that a single object of class LL can be used to manipulate a linked list . … | |
is there is any way to access 3rd element of a linked list without using arrow operator?? | |
I am writing a program that reads customer info from a file, then reads transactions from another. I am building my ADTs for this as I cannot use templates for this class yet and have a cpl of issues. The linked list contains the clientID as an int and a … ![]() | |
ok i try to write a linked list of objects from one class here is the the class: [CODE] class detail{ int code; string unit; string name; float price; public: detail(int c, string u, string n, float p); int get_code(){return code;}; string get_unit(){return unit;}; string get_name(){return name;}; float get_price(){return price;}; … |
The End.