2,180 Topics
![]() | |
how to store the info of student in the linked list PROGRAMS 3 0.4 LABS 3 0.1 EXAMS 3 0.5 Student Student 1234 PROGRAMS 90 85 88 LABS 99 65 85 EXAMS 67 85 56 John lastname 3456 PROGRAMS 95 90 98 LABS 91 75 90 EXAMS 55 63 92 … | |
hello i wanna enter a function that contains various data types to be displayed in a linked list , but the problem that the program can't convert from int to void , and of course i can't make an int function for a string or char here is my function … | |
Input: A, B, C, D, E ... [CODE] 1/1 1/2 2/3 3/4 2/5 [/CODE] Output (Queue!): [CODE] 5 B 1 E 3 C 4 D 2 A [/CODE] How to make this? Mark competitors (persons) Example: A ... E their come in first queue. A can label/tag 1/1. B can … | |
Hello all, Info: I am using Pelles C compiler. Some code first: Following is the linked list structure I am using. [CODE]typedef struct _NODESTRUCT { void* data; struct _NODESTRUCT* next; } NODESTRUCT, *PNODESTRUCT;[/CODE] Method to add a new node to linked list: [CODE]PNODESTRUCT AppendNode(PNODESTRUCT rootNode, void *data) { PNODESTRUCT tempNode; … | |
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 … | |
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. … | |
I am in my way of studying the linked list chapter of C++.. So i go through this code below intended of understand it. [CODE] #include <iostream> using namespace std; struct nodeType { int info; nodeType *link; }; void printList (nodeType *first) { nodeType *current; current=first; while (current != NULL) … | |
Hello everyone, I've used this website many times to help myself based off of others' questions, but now I have a problem of my own that I can not solve. I was assigned the task of creating a stack program in C++ using a linked list. Seems simple enough, but … | |
I'm having problems trying to implement a counting sort for a template linked list. I already coded everything and I get the correct output. Now I just need to sort using counting sort method. When I run the project, the program crashes and it says: First-chance exception at 0x00262805 in … | |
Write a 'C' Function to combine two singly connected linked lists in the following manner. Suppose one list is "L" which can be given by L=(l0,l1,.....,lm) and the other list is "M" where "M" can be expressed as M=(m0,m1,......,mn) where each li,mi represents one node in the respective lists. For … | |
Hi, I would like to make an threaded app which would use pthreads. I made a linked list and I put references to running threads here. I know that operations of adding a new thread reference to the list and removing a thread reference from the list after the thread … | |
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.. | |
The program I am writing is supposed to read in a txt file and then align the txt depending on the number of characters per line that the user has specified. Since there aren't any limitations to the length of the text it has to be represented using a dynamic … | |
![]() | Hi, I'm trying to multiply two linked lists and return the result as a linked list. Any ideas? |
Hi, I am writing a code that reads input from user to create a linked list database at the same, time it write the data received in to binary file. when I run the program is supposed to prompt the user to enter the data for ten time, however the … | |
I'm supposed to implement a queue using a singly linked circular linked list (it also has to be generic). It keeps saying there are incompatible types at lines 44 and 45. I've honestly been trying to work this out for hours, but I don't understand what i'm doing wrong. Any … | |
Hey guys, Well looked at a job online (IT consultancy job) and they require good level of procedural c++ programming ... I was wondering if anyone could hep me with any ideas or can show me any sites with advanced project ideas. All I know is linked list which I … | |
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 … | |
[COLOR="Green"]Hi, I'm trying to write a linked list Program to accept a no. and print all the prime numbers less than it, using the sieve method, Explained below: Suppose that n=30.Then we list all the numbers till 30, and cross out 1 and all the multiples of 2, then 3,then … | |
Hi there everyone!! Struggling a bit with some Linked Lists combined with copy constructors as well as operator overloading. Here is the code of the header (.h) and the implementation file (.C). Hope that you can help! [CODE] /////////////////////////////////////////////////////////// ////////////////// //////////////////// ////////////////// Queue.h //////////////////// ////////////////// //////////////////// /////////////////////////////////////////////////////////// #ifndef QUEUE_H #define … | |
For my Computer Science class, we are writing several different methods to reverse a singly linked list in Java. I cannot figure out the last way, which uses three helper methods, pointerToLast(Node n) which returns the tail node, nextToLast(Node n) which returns the second to last, and append(Node a, Node … | |
[url]http://pastebin.com/aefXKD9w[/url] This is my code. If the command line csv file (for example, input.csv) has the following: Fred 22 Stella 11 Nellie 33 George 11 Violet 33 Rose 11 Bob 33 Lena 11 Billy 22 1) It should first print Fred is 22 years old.. Stella is 11 years old.. … | |
Hello, I'm having trouble translating an algorithm. I'm not sure I coded bits of this correctly, but I'm certain that I have no idea how to compare an item with a node identifier (cannot apply > operator with T,T) but since this is an insert sorted method rather than insert … | |
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 … | |
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 … | |
following is my main program Linklist is a class of circular Linked list so my question is since the parameter of function doesn't contain Linklist in it can I go ahead and call it "List" in any function, such as List.print(), anyway? [CODE]main() { linklist list; int choice, num; do … | |
Okay, I have a header file I am trying to stub out to my_list.cpp but I keep getting these errors that I do not understand and have been working down to them but I got stuck. I figure I'm in deep trouble seeing as I can hardly stub these out, … | |
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 … | |
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 … | |
Ok so Im trying to create a constructor that reads input from a text file. Which I got it to do. Then adds the information to a LinkedList. [CODE] public class CourseCatalog<T> { private BufferedReader read; private LinkedList<Course> catalog; public CourseCatalog(String filename) throws FileNotFoundException { catalog = new LinkedList<Course>(); try … | |
I am attempting to edit this Queue class to only use myBack pointer, i began having errors and now I am lost.... LQueue.cpp is as follows [CODE]/*--- LQueue.cpp ---------------------------------------------------------- This file implements LQueue member functions. -------------------------------------------------------------------------*/ #include <new> using namespace std; #include "LQueue.h" //--- Definition of Queue constructor Queue::Queue() : … | |
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? | |
Hello guys, been struggling with implementing a linked list. I'm using this function AddToList to add elements. I'm clearly doing something wrong because no new element is added. Although when Im using a breakpoint inside the function i see that it seems right. [CODE] /* Main.cpp */ #include "LankadLista.h" #include … | |
I am facing this problem where one thread keeps adding packets which it receives from the network to linkedlist. And the other thread retrieves it from the linked list. The below is the code of the Thread which keeps receiving the packets and add's them to list. [CODE] private class … | |
Hello, Basically I'm trying to use operator<< to display items from a linked list. coding in the header file. [CODE] template <class DataType> struct Node { DataType info; Node<DataType> *next; }; template <class DataType> class LinkedList; template <class DataType> ostream & operator<<(ostream & output, const LinkedList<DataType> & rlist); template <class … | |
I'm making a hash table using a linked lists to handle collision. So I'm creating an array of "head" pointers to access each linked list. I can't figure out why I'm getting the error below: error C2440: 'initializing' : cannot convert from 'LinkHash::ListNode' to 'LinkHash::ListNode *' I commented **not working** … | |
can anyone help me look over my code? The Course class A Course object should store the department, course number, and course title. It should have linked lists of prerequisites and "subsequents" (the courses for which this course is a prerequisite). The constructor should construct a course given a department, … | |
Having a problem with assigning a string in this linked list, any ideas? the line that reports an error is highlighted in red. I would expect this to work as variable 'name' is a char array and i am simply assigning the string "Vin" to it. [CODE]#include<stdlib.h> #include<stdio.h> typedef struct … | |
I am trying to write a program that will take a text file and parse the words into a linke dlist that will be then printed to the screen with a user defined number of characters per line and I am running into some runtime issues with opening and procesing … | |
Hello, I created a linked list and implemented a deep copy function. However, the copied list skips the head node in the source list for some reason. So assume source list contains the following data in their respective nodes: 1 3 6 7 10 312 The copied linked list will … | |
Hi, I'm fighting a battle with a linked list and I am currently losing. I am using the toolkit, pointers, nodes and a class. My code is still buggy because after building it, it just runs for a while then stops. Please help. Here is what I have, an implementation … | |
The program I am writing is supposed to read in a txt file and then align the txt depending on the number of characters per line that the user has specified. Since there aren't any limitations to the length of the text it has to be represented using a dynamic … | |
Hi, I am new to C and C++. This is my first course on the subject and my instructor handed out a printout in class with code on it to get us started, but he did not go over any other code or teach us any C. I can only … | |
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 { … | |
Hi I'm currently working on a college programming assignment and for this assignment I need to create a contact list of first name and last name and store them as the program runs I may not be able to explain this well but I understand what i have to do … | |
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 … | |
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 … | |
Hello, I've been having problem with understanding merge sort for linked list. I understood merge sort for array though, I think. I've googled it and all I can find are codes. I need to understand the algorithm first before I can understand the code. Please help me understand merge sort … |
The End.