2,180 Topics
![]() | |
When define an template linked list inside an in order linked list I can't access the nodes of the internal template linked list by first and next functions Or in other words the template class can't be passing by reference??? :-O | |
heres my code: [code=java] import java.util.Scanner; import java.lang.Integer; public class hmwrk4 { public static void main(String [] args) {Scanner kbInput = new Scanner(System.in); System.out.print("number of the element to delete: "); int numEle = kbInput.nextInt(); Node n8 = new Node(new Integer(8), null); Node n7 = new Node(new Integer(7), n8); Node n6 … | |
Can someone please help me find out why I am getting a nullpointerexception for this code. Ive been racking my brain and cant find it for the life of me. The program is supposed to delete an element from the linked list that is built in the main method and … | |
For this code to delete an element from a linked list how do I get the head to point to the first element in the list(which is 0)? [ICODE]public class IntNode1 { public int item; public IntNode1 next; public IntNode1 head; //////Constructor/////// public IntNode1(int item1, IntNode1 next1) { next=next1; item=item1; … | |
I am trying to write a program that will delete the nth element from a linked list. Before I was getting a nullpointerexception but I think I cleared that up. Now I just get a repeating error message that I put in the code for when the list goes to … | |
Hi, I am trying to write a code that will delete an element from a linked list and then display the updated list, but I keep getting a nullpointerexception, does anyone know where I went wrong? [ICODE]import java.util.*; public class IntNode { public int item; public IntNode next; public IntNode … | |
I need to write a program that will read in a polish string and calculate the value of the string, using 2 linked list, a polish queue and evaluation stack. Here is what I got so far: [code=cplusplus] #include < iostream> using std:: cin; using std:: cout; using std:: endl; … | |
Hi guys!I'm in great need and embarassment.I'm new to the C++ program and to be frank I'm having a hard time understanding it. Now our topic is about linked list and my professor gave us this machine problems: 1. Write a program that implements a linked list using an array.Your … | |
Hi :) I have a question, if you don't mind =] (What is the situation where quadratic probing is better than chaining?) I guess (as I'm thinking) while searching? maybe? because if the Hashtable have a lot of elements in chaining it'll take a lot of time searching the Hashtable … | |
my assignment is to write a 2 functions that check how many elements are in a linked list one of the functions have to solve it recursively and the other through the use of a loop. When compiling my code, I run into a load of errors and can't seem … | |
Hi, I have a problem, if any body can solve it, please help me please urgently.Thanks... You are going to implement the doubly linked list (DLL). Your task is to simulate a workbench robot for wagon construction. Assume your DLL is a train with red, green and blue wagons. The … | |
Please help with the following linked list program. Any help is good =] Use a linked list to do this program a store recieves shipmesnts of chairs at various cost. the store policy is to charge a 35% markup, and to sell chairs which were received earlier before chairs that … | |
Hi I have to make a C program which has to perform a specified event at a specified time. Something like this... [code] Print Hello at 13:15 Print Bye at 14:20 Print working at 13:57 [/code] Assume that these instructions are already available. I am thinking of creating a doubly … | |
Hi, i'm new to C programming and i could use some help with an assignment. i would like to store a word in a linked list, with each letter of the word in a separate node of the linked list. i would then like to traverse the linked list to … | |
I have to design and implement a new linked class called StudentList, to represent and manipulate the records of students enrolled in a course. The data field for each record in StudentList must contain: student name (string type) studentId (int) (from 0 to 10000) dept (string) major (string) In the … | |
Greetings, I'm trying to write a function which gets two pointers as parameters. The first one "points" to the start of the first linked list, the second one is currently on null, but it will later serve as a pointer to the start of another linked list. The function is … | |
I have a code for a doubly linked list, and I need to print it in reverse. I can't seem to figure out what I'm doing wrong, or maybe I just don't fully understand what I'm doing. The part that I'm questioning is in the printList function. The while statement … | |
[code] struct fifo { int result; char *info; struct fifo *next; }*node; void add(struct fifo **n,int data,char *text) { struct fifo *temp,*node1; if (*n==NULL) { temp=(struct fifo *)malloc(sizeof(struct fifo)); printf("%d is to be stored\n",data); temp->result=data; printf("%d is stored\n",temp->result); temp->info=(char *)malloc(strlen(text)+1); strcpy(temp->info,text); temp->next=NULL; *n=temp; } else { temp=*n; while(temp->next!=NULL) temp=temp->next; node1=(struct … | |
Hi everybody, I have interview on next week. I know some question will come from link list. What kind of question will come in face-to-face interview's?. If some one post that kind of question, that will be very helpful to me. In this interview Question will be in C only. … | |
I have made a singly linked list that holds an integer & a string. The creation of the list works fine but deletion of a node is giving an error. Previously I was not adding a string to my list(only adding int)& at that time the code was working. please … | |
i want to delete the entry of a student using its roll no....its not working It is my earlier program and i just modified it but now i am not being able to perform deletion operation..if you will help me my project will get over.. [icode] #include<stdio.h> struct student { … | |
PLZ HELP ME WITH THIS CODE...I HAVE GIVEN THIS CODE SO MANY TIMES BUT NOBODY IS ABLE TO CLEAR MY ERROR.... 1.DISPLAY IS NOT COMING ONLY LAST VALUE I ENTER IS DISPLAYED 2.DELETION OPETATION .............AND YES I WANT TO USE LINKED LIST....IF ANY 1 KNOWS IT TELL ME............. [ICODE] #include<stdio.h> … | |
hello, ok i have this simple linked list program, as u can see below i got three functions: one to insert a node in the first of the list, the second to insert a node in the middle and the third to insert a node in the last of the … | |
i am facing problem when i am trying to get input...my input is not being taken correctly ... #include<stdio.h> struct student { char name[20]; int rollno; struct student *next; }; void display(struct student *first) { struct student *ptr; ptr=first; printf("\nCurrent list:\n"); while(ptr!=NULL) { printf("Name:%s\nRoll:%d",ptr->name,ptr->rollno); ptr=ptr->next; } } void delet(struct student … | |
when i am entering name and roll no only the last name and rollno is displayed and rest is not....i unable to detect where i went wrong and also ...deletion operation is also not working.........and ya i want to try this using linked list...plz i have to do this ne … | |
I am trying to do a simple queue using linked list. I am failing to perform dequeue because I cant get the logic straight. If there is anyone who could explain to me about the simple logic of this then it would help alot. Thanks. I have also posted the … | |
Im trying to make a sort of menu and im not sure how to do it. I want it too build the structure from a file and/or input and im not sure what kind of data structure i should save it it. I´ve been thinking about a linked list with … | |
I am trying to pass a whole recordset into a query. I have made a form, with a listbox that is linked to a table that has 2 columns: Country and CountryID. When I select the Country on the form, i need the Country and the CountryId to be passed … | |
Hello everyone, I have a project which is to find the permuted index of each word in a textfile. Im restricted from using STL btw. I read in input.txt and have to output each word and corresponding line number and if it is found multiple times, it will have (numoftimes) … | |
Hello everyone, My project consists of reading 2 lines of integers separated by white spaces corresponding coefficents and exponents, each line representing a polynominal. I have to add both polynominals and subtract them. I have made a linked list class to hold each coefficent and exponent in a node. The … | |
I supposed to make in memory linked list. I thought I did it perfectly. My teacher is kind of the teacher that won't teach you but let you figure it out.. I couldn't figure it out!!! I supposed to make one like this but to manipulated the list. I am … | |
Hello, sorry to ask, but does anyone know any working algorithms for quicksorting a doubly linked list? I'm only asking because I'm going to rip someone's head off if I have to keep doing it by myself any longer :P Don't worry, I understand how to it on my own, … | |
i've created a linked list which stores some info about documents such as code,title,creator,filename,... i've also stored some info about some other documents in a *.txt file i've got a search function in my program that gets a code from the user and tries to find that code either in … | |
I want to declare my linked list as external in my header file..so that my head and current pointers are globals..i have done something like this but i dont know where the problem is..i want the values of head and current to be initialized and used by all the other … | |
I found a problem with how to find a maximum value with linked list... but it didn't need a parameter... | |
I ran into a roadblock developing my code for an assignment to sort a linked list as it is entered (insertion sort). We've had sketchy classes lately so the idea of linked lists is really rough for me at the moment because it's a little hard to understand. This assignment … | |
hello, I m working on a Ford-Fulkerson algorithm to get the Maximum flow in residual graph, and min-cost algorithm. My representation based on adjacency-lists approach, where I keep track of all the vertices connected to each vertex on a linked list that is associated with that vertex. So far I've … | |
am trying to delete an element from my list but am having a problem..i have managed to position my pointers well but av failed to to the actual element. i.e user enters a number to be deleted from the list..here's the bit of the deleting code that i have been … | |
I'm new at C++ programming and am working on an assignment. I've managed to compile my codes alright but got an error while testing the program. The error surfaced halfway through viewing details of a linked list, where suddenly, the program started printing weird characters while the computer emit beeping … | |
Hi guys! I am currently having trouble in the final stages of an assignment which involves linked lists and dynamic arrays. The assignment involves adding books to a library. This means that each record has a title and one or more authors. I have worked out what I think was … | |
hey guys. ive created this function that will delete the first element it finds in a linked list that has the value n in it. it works except when the number is the FIRST element in the list. it wont delete it, it will replace it with a 0 when … | |
I'm doing a project for college. It's not too complicated but it involves a lot of data access on a linked list. Does anyone have any tips for designing an intuitive command line gui? I'm doing things like: [CODE=C] while (current !=NULL) for (i=1;i<10;i++) printf("%d *Name: %s\n",i,current->data.name); current=current->Next; switch (get_char()) … | |
I've got a question...we all know double arrays a[100][100], but how to change it into linked list or like" linked list to linked list" that we could transfer data like in a double array a[i][j]? 12345.... 2 3 . . . Ideas? Graph>weighted>minimal tree>neighborhood list(yes normally matrix, but i need … | |
hey guys. ive been asked to do this: Write a recursive function which returns true if the linked list is sorted in ascending order. bool isSorted(nodeType *L) why would we use a recursive function to check if it's in ascending order? can anyone help me with this. | |
I'm working on a lineEditor class (doubly linked list) and I'm switching it from using std::string to a template but I keep getting: lineeditor.cpp(33) : error C2143: syntax error : missing ';' before '*' when compiling. The code is: [code=c++] template <class T> int lineEditor<T>::getSize() { return maxLineCount; } template … | |
I am trying to call the method ip_uri from class into the main but it does let me what am i doing wrong? [code=cplusplus] #include <iostream> #include <string> using namespace std; class ip_uri_store { public: string count; // C++ string s are classes so this is aggregation. int id ; … | |
[[U]I][B]My Doubly linked list doesnt work when i try to display using backward/reverse traversal... Will you please help me....[/B][/I][/U] [IMG]http://www.withfriendship.com/user/images/616/1vijay.jpg[/IMG] | |
okay so I'm not sure how to do this, but suppose i have a struct that looks something like this: struct soundNode{ string identifier; sound new_sound; soundNode* next; soundNode* prev; }; sound is an object that is defined by a .h file. and in my main program, i have a … | |
Not certain if this is the right place to ask this. I need to get two processes to use the same data. Process 1 reads text files, parses them and creates linked lists (structures).before this process terminates it display all the lists to prove the data has been loaded correctly. … | |
Am trying to extract a string of characters and numbers from a text file into two different data types in a linked list...i.e the if the text file has the data myname 100 i want the "myname" to be stored as a string and then the 100 as an integer..can … |
The End.