2,180 Topics
![]() | |
How to create a java class to represent linked lists of integers. Provide it with methods that can be used to reverse a list and to append two lists. | |
hello every body i want to know how to save a linked list int a text file and how to load a file in a linked list ?? any one can help me and give me a simple example code thanks in advance | |
Hi, Can someone tell me If my code is right? It compiles ok, but I am not sure if the implementation is right. I am trying to write a singly circular linked list class with insert, getfirst, getNext, delete and empty methods. Can someone help me with this? Thank you … | |
Hi, I'm doing 6Lowpan adaptation layer using c++. I would like to create an array of linked list - each element of array consists a linked list - each linked list links all fragments of same tag together according to their offset Is this correct? myarraytype* myarray[myarray_size] = mylinkedlist; Thanks. … | |
I have an assignment where I need to do some operations on polynomials (add, multiply, ...) which are represented by linked lists. Part of the assignment is to make an inner class Term containing two int fields and a constructor with coef and exp ints) I also need an inner … | |
There are n persons numbered from 0 to n - 1 standing in a circle. The person number k, counting from the person number 0, is executed. After that the person number k of the remaining persons is executed, counting from the person after the last executed one. The process … | |
Hi all, I am new in java. How can I sort a linked list on the basis of a particular string..? I have created a class with two elements, 1. Name 2. Address and I am reading these elements many times Now I want to sort this on the basis … | |
So im working through this and im having troubles finishing it off. Essentially im reading a text file, and tokenizing the numbers in the file, but what needs to be done is for each line in the file to be store in its own Queue, and then the Queue's need … | |
Hi guys, I am new to java and I need to create a a singly linked circular list in java with the following methods: insert new node, delete node, get next node, get first node and create empty list. Here is what I have so far and I am not … | |
Is it possible to write a method and declare something like [CODE]Node currentNode;[/CODE] to "scan" through each nodes in the list, and saving to file. I guess I can use [CODE]import java.io.*;[/CODE] to declare the necessary file stream variables. Would really appreciate some ideas and tips on how to approach … | |
I'm getting a segmentation fault at this line. So far, my program has classes. A blahpod with class of songs in them. Then there is the node class. I call the operator= which is supposed to put one pod into another. It looks like so [CODE]bobcatPod bp2( bp1 );[/CODE] That … | |
Write a program that simulates the “heap” using a linked list. This program should take one node of size 9096 kb. Assume all request will be made in kb. The user should request a size of memory from the system, then the system should find memory that can be allocated … | |
I am having troube getting this program to compile. I have been on it for the past 5 days and starting to feel burn out. maybe an extra set of eyes can point me in the right direction of what i'm doing wrong. The error messages i'm getting are: expected … | |
[CODE] template <class T> class Llist //.... //Iterates to position and sets pointers to node at position-1 and position. template <class T> void LList<T>::iterate(Node<T>*& previous, Node<T>*& next, unsigned short pos) { //some code } //Start Iterator template <class T> inline Iterator<T> LList<T>::start() { //some code } template <class T> class … | |
Hello, I have this assignment I'm supposed to deliver tomorrow, I have most of it figured out, but there are certain bits and parts of the question I can't figure out... I'll show you what I mean, here's the entire question: [CODE]Develop two linked lists to manage the list of … | |
Hi, I'm having a strange problem with my linked list program. This is slightly embarrassing because I'm getting back to coding in C++ after 4 years and don't remember much. This is the code [CODE]#include<iostream.h> #include<conio.h> #include<string.h> void printList(struct node *&); struct node { node* next; int data; }; int … | |
Hello everyone...I'm trying to create a journey planner for an underground system...but the first thing Is to create the skeleton of the underground system... my problem is I don't know how to add more links to a single node when the station has an intersection with other lines... [CODE]public class … | |
I need to pass a linked list (via unnamed pipe)that is created by the parent process between one child process to another child (created by the same parent). However I am not sure that it is proper to pass it by address of the head node or the complete structure … | |
hey, kind of new to c++ started working with functions and am trying to write program using them trying to make hangman game using functions, with my following code i am getting this error message [linked error] undefined reference to 'askGuess()' id returned 1 exit status [build error] [ number5.exe] … | |
I truly don't understand what this assignment is asking, and this is it design a simple linked list class with only two member functions and a default constructor: void add(double x); boolean isMember(double x); LinkedList( ); The add function adds a new node containing x to the front (head) of … | |
This is a singlylinked list code.This shows no error but while execution it shows singlylinkedlist.exe has encountered a problem and needs to close thanks in advance [code] #include "singlylinkedlist.h" #include <iostream> using namespace std; class singlylinkedlist //class for linkedlist { private: struct node //struct daclares the abstract data and link … | |
Hey guys! I am working on a project using single linked list and currently on the last task which is overloading the += operator. My merge from a+=b is inefficient because I am having a memory link problem and its slow when it used in list size of 100000. Please … | |
![]() | Please help me with the double linked list, when I write the command in terminal to test main class by my source code the cmd.exe throw me: Exception in thread "main" java.lang.NullPointerException at homework.List.add(Homework2.java:19) at homework.Homework2Main.main(Homework2Main.java:20) In 19 line is something wrong in source code, I tag him. Please I … |
[CODE] #define cinGetValue(value,status) \ { \ string inputLine; /* raw user input text*/ \ istringstream convert; /* string converstion variable.*/ \ \ getline(cin,inputLine); /* get a string of data from user input (could be empty) */ \ convert.str(inputLine); /* load 'convert' with user input */ \ convert >> value; /* … | |
Hey all! I am having trouble debugging my program, and after exhausting all of my options i decided to come to you guys. The assignment requires us to create our own custom linkedList class representing a polynomial, where each term is a link. I have most of it working, but … | |
im having problem on creating methods for bidirectional linked list.could you guys help me out. many thanks | |
Hi all, I have a doubt regarding finding a loop in a linked list.I searched on internet and found 2 different ways of doing the same. But my doubt is that if a linked list has a loop, then wouldn't it be a circular linked list? If yes, then the … | |
![]() | Hi, I have some problem i must to do some homework for our subject called object modeling in java. Award: Add code to the List class. Inserted numbers should be in two way linked lists stored in ascending order sorted, duplicate values are allowed (re-inserting the same value of nothing), … |
I feel bad for asking all the questions about the STL list, and thanks to those who have been helping me learn. I have a question now about inserting again, except this time I want to insert an extra data point into a tempList. I have commented out the code … | |
Hi, I'm trying to run a program I have coded that has the following setup: There is a tree containing "player" objects. Each "player" object has a linked list containing "weapon" objects. Each "weapon" object has a stack containing "round" objects. I need to set it up so that of … | |
Hello all, So I am having trouble figuring out a runtime error I am getting in my code. Essentially I read in data and push it into two lists (using the STL list). Then I use the .sort() function to sort the data by average. However I am having a … | |
This is part of my linked list program. I need to change the data(node) with a new one when it is found (using the find function. And in other case I need to delete the found item using deleteNode() function, once the matching item is found. But, it is not … | |
Hello all, I know there is a "sort" method in the STL for list. However I am not sure how to use it, and my research was unable to help me out. What I am trying to do is sort my master list by the averages, lowest to highest. Can … | |
Hi, I'm working on this program where I have to do some updating. In this case, I have to add a new item to the linked list, and it should be in a sorted fashion (ascending). I am trying to use my find() function, which returns the previous node (*ptrPrev). … | |
Hey I am writing a double linked list dictionary of sorts. All of my functions were properly (add element after, move pointer, search, etc.). However, something is wrong with my add before function. Initially it adds elements fine, however if I decide to move the pointer to a new element … | |
My program is a implementation of the Sieve of Eratosthenes algorithm, which finds primes number. It stores two integers up to the maximum, and all odd numbers from 3 upward. It also checks if, for whatever any reason the first number ever reached the square root of the maximum number, … | |
I need help with this problem, here. I have 2 functions: "find4update" is supposed to compare the incoming parameter "item2" to the item that is already in the linked list, and return the value of "found". And my second function "deletNode" should use that "find4update" function and delete the found … | |
Hello all, So I am new to the whole STL List class, and I am a little confused. In the past I have always had two classes, a data class and a "linked list" class. So now I have a bit of a pickle when I try to make a … | |
Creating and maintaining a database. The program should make use of functions, linked list, structures, arrays, pointers, and data files (input and output files). It should be able to do the following: Add record, delete record, update record, Sorting & Searching (on both string and numbers), triggers, and alert messages … | |
Okay so I have some questions about LinkedList. I'm doing an assignment on LinkedList and I noticed in the java API that there is a get(int index) method built in for LinkedList. From what I was reading LinkedList is set up like this node1->node2->node3-> where each node has reference to … | |
Hi, I am working on some practice problems for my class and I keep getting stuck on this problem. It is using linked list, I am bit stuck. The problem is to write a function int testloop (listnode *head) that checks to see whether the list 'head' contains a loop. … | |
I am doing a project where I have to make a Facile program that reads and executes statements line by line. Example would be like: LET A 5 ADD A 8 PRINT A END and that would print 13 to the console So I have a class for each of … ![]() | |
Hi - i have been trying to create a linked list in C using structs and there are a couple of things i am stuck with how to declare the node front and back and do i keep repeating myself? Also in the function push back how can i use … | |
Hey all, I've used this site quite a bit as a reference, and couldn't find a solution that worked for me. So I became a member. :) Anyway, I can't get my insert function to...function when I go to add a node. The node is NOT to be just added … | |
My project this week is to perform basic linked list operations. We didn't learn this in class, and the TA that attempted to explain can't speak English very well, so I'm having trouble understanding what I'm doing wrong. I linked the entire file, but I only had to implement the … | |
Hi, I'm working on a linked list filled with class objects and I've encountered a weird problem that I cannot see how to resolve. I declare 2 self-referential pointers within my 2 classes and the error: In file included from prog2.cpp:16: employeedatalist.cpp: In function âvoid getData(std::fstream&)â: employeedatalist.cpp:15: error: âheadâ was … | |
hi please solve my problem i am getting linking error in following program. i am using devc++ for copilation linking errors: C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x286) In function `ZN4list7delnodeEi': C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x286) In function `ZN4list7delnodeEi': [Linker error] undefined reference to `list::search(int, Node**, Node**)' C:\Users\shiv\AppData\Local\Temp\ccaMbaaa.o(.text+0x62c) ld returned 1 exit status [CODE]#include<iostream> #include<conio.h> #include<string.h> using namespace std; class … | |
1) Write a function that merges two instances of the List ADT using the following specifications: MergeList (List list1, List list2, List& result) • list1 and list2 have been initialized and are sorted using function ComparedTo • result is a sorted list that contains all of the items a. Write … | |
Hi, I created a program using the linkedlist package. I encountered an error when I tried to insert an element... By the way here's my code... [CODE] import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.*; class guiListOperations3 extends JFrame implements ActionListener { static LinkedList <String> list=new LinkedList <String>(); static JLabel … ![]() | |
Next week I am going to begin learning about linked list, I know very little currently. Are there any well written explanations of linked list online? Or can someone explain the logic to me. Want to have a background before I start learning it from my professor. |
The End.