2,180 Topics
![]() | |
#include <stdio.h> #include <malloc.h> struct node { int data; struct node *link; }; void append (int data, struct node **s) { struct node *p, *q; if (*s == NULL) { p = (struct node *) malloc (sizeof (struct node)); p->data = data; p->link = NULL; *s = p; return; } … | |
I would like to know what tool/class should I use to create a map that used for games? such example: user use key to move an object...and if moves then the more map will shown ... I admit, I did not do much research on this.. but I wanted to … | |
Hai friends,I was developing a code for linked list operations. But while doing deletion, if we give a position except 1, the particular node will be deleted. But if i give position as 1, the node will not be deleted. Please help. I'm posting the code below #include <iostream.h> #include … | |
hello can any one give a easiest and understandble link or video tutorial for cursor implementation of linked list very hard to understand please suggest a good link and understandable | |
please give me a good link for polynomial manipulation of linked list | |
Hi, I'm working on a quick sort for double linked list. All work except the first item. I don't know what is wrong. Can u plz help me find the error? Here is my code. dlist_t* quick_sort(dlist_t* list) { dlnode_t *tnode = NULL, *first = NULL, *last = NULL; first … | |
Hi, I wrote the following program for stacks using linked list! But, the display function doesn't seem to work! can anyone point out the errors in this? Thankyou! #include <iostream> #include <cstdlib> #include <iomanip> using namespace std; template <class T> class stack { T data; stack<T> *top; stack<T> *next; public: … | |
Since in XOR linked list current pointer store the XOR of addresses of previous and next node. my question is how do we XOR two pointers? | |
Ok so this is my code so far: I have a issue where near the end in the getSum() method I need a way for the all the methods that i have that ask for the user input need to go into the respective arrays that i made in the … | |
I'm working with some old code and the users tell me that the original program's output was a single binary file containing multiple stuct data. The output I get is a binary file containing a single structure. The comment also indicates that this what is happening but I need to … | |
I have a project to create a pointer based linked list. I am having a problem with the contains() indexOf() and lastIndexOf() methods. I am not able to compare iter->item!=o. This is my ArrayList.cpp. I will follow it with ArrayList.h and Country.h (the ArrayList uses a typedef of the Country … | |
Hi All, I am trying to link two database in different servers. Are there any ways I can do this? If this possible, could anyone show me how to do it. I've been googling it a few weeks ago, there are sites that said to use the sp_addlinkedserver but I … | |
Hello. I am having a tough time understanding the concept of double linked list. For now, i understand double linked list has 2 links, one forward and another one previous. data is in the middle. when inserting must check where to insert. if previous is equal to null, then can … | |
Hello there, I am new to C++. I have a task from school to make simple sorting program using Insertion Sort with a linked list. I would like to have comment, feedback, and correction of my code below. #include <iostream> using namespace std; struct Sort{ int value; Sort *next; // … | |
import java.util.*; public class MyLinkedList { private Node head; private class Node { private String element; Node link; } public MyLinkedList() { head=null; } public void insertAtHead(String ele) { Node curr = new Node(); curr.element = ele; curr.link = head; head=curr; } public void insertAtTail(String ele) { Node curr = … | |
I am trying to write a program to make a list of books using linked list. I am using C language. My program crashes as soon as I finish entering the list. It is supposed to print the list before exiting. Any ideas ? //Defining what libraries should be included. … | |
[ATTACH=RIGHT]16896[/ATTACH]Welcome to the new [URL="http://digg.com"]Digg[/URL], somewhat different from the old Digg. In version 4 of the popular news aggregator site, rolled out today to users, will the new features manage to renew the site’s popularity, reversing the trend which has dropped them from 30 to 25 million visitors per month … | |
struct node { int data; struct node **next; }; can we use like this??? | |
Hello I am having trouble with my project crashing for every case. We are told to read in a data text file and store into structs and create a linked list of data and allow a user to choose from 4 menu options. I am completely new to linked lists … | |
Hi Guys... I seem to be having an issue when trying to create a new row in a Dataset. Below is the following Connection Details to the Access DB. private void radioButton3_CheckedChanged(object sender, EventArgs e) { cashCustom.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Orders.mdb"; cashCustomerDS = new DataSet(); cashcTable = new DataTable(); cashCustomerDS.Tables.Add(cashcTable); cashCustom.Open(); … | |
hi, i have seen somany people asking about fnding loops in a single linked list. i would like to know is there any advantange or necessity for having loops in a linked lists. is there any application that really requires loops in lists. Thanks, Gaiety | |
hello, im having troblue getting my linked list to show everything on the list. it only shows the first node, and nothing afterwards. #include <iostream> #include <string> class list { private: struct node { std::string name; std::string phone; node *next; }*head, *tail; public: list() : head(0), tail(0) {} ~list(); void … | |
Hello, guys! I have the following code:[CODE]#include<stdio.h> #include<string.h> #include<stdlib.h> struct list_word { char word[64]; struct list_word * next; }; typedef struct list_word itemWord; int main() { itemWord * curr, * head; fill list with words [B]remove duplicates[/B] show final list of words return(0); }[/CODE]So I experience difficulties when implementing the … | |
hi, i am trying out past year questions for a resit and am stuck with the question below. Question 1 In the following you may assume the existence of the ListIterator<e> interface and LinkedList<E> class with the following methods public interface ListIterator<E> { E next(); boolean hasNext(); } public class … | |
hey, i've been trying to insert the element in the linked list, but I don't understand why the element is inserted at some other position i.e. it is not inserted at the position which i pass. is there any error in the insert function? template <class T> void insert ( … | |
hello guys, I 've just recently stated writing algorithms in Data structures. I want questions to write algorithms in array and linked list, please give me questions in that. The questions can be of difficulty level easy and medium. thank u. ![]() | |
As usual I know I'm probably doing something stupid. I'm trying to write the program below but I seem to have handled my queue incorrectly. The problem could be in one of three places; the way i handle moving on to the next node, my addboard function or my printsol … | |
I have a little problem related to the white spaces in my program. Well, the actual program I'm trying to make is something else. so this program is just to check whether the text is properly broken or not. The problem I'm facing is, for the first word in my … | |
![]() | Hello guys ! Hope you're doing well. I have faced a problem in declaring linked lists inside a linked list. I made a picture because it speaks more than 1000 words  Here's my structure declaration: typedef struct author *link; struct author { char name[20]; link next; link down; … ![]() |
Hi everyone well currently I am working on a simple malloc and free implementation but I am facing some problems . I get a segmentation fault this is my output inserting node 0 0xc87000 inserting node 1 0xc87014 inserting node 2 0xc87028 inserting node 3 0xc8703c inserting node 4 0xc87050 … | |
I missed one of my classes for data structures. Can anyone give me a general guide in solving this simple recursive problem using Linked lists. Where one has to find the min and max values of integers stored in a linked lists. Here is methods i need to use. Write … | |
#include<iostream> #include<conio.h> using namespace std; struct node { int info; node *left,*right; }; int main() { struct node *root; root=NULL; //root->info=NULL; //root = (struct node*)malloc(sizeof(struct node)); if(root==NULL) //cout<<root->info; cout<<root->info<< " "<<root->left<<" "<<root->right<<"\n"; getch(); return 0; } why it is giving an error? ![]() | |
![]() | hi... Can you please help me by giving only some HINTS of algorithm used to solve this. I AM NOT ASKING ANY CODE OR SNIPPET FROM ANYONE. I just want hint or algorithm to use... There is a linked list where some nodes have similar number. Sort them such that … ![]() |
> Hi everyone, I have to implement a circular queue using linked list here. > We imagine a queue in a circular shape where we break at a point such that now it has 2 ends > Now we have to perform insertion and deletion at both ends one at … | |
Hi All, I am tasked to generate report templates in excel and I am new to excel, VBA and still learning. A little more information on my task, the information for the report will be extracted from different sheets in the workbook which contains a whole list of calculation and … | |
Hey everyone, I'm working on an assignment and I'm having some trouble figuring out how to implement two operators. The program creates and implements a class to represent the Stack ADT using a singly-linked list. There is a driver program to test my implementation. I have everything implemented (except the … | |
What is the importance of a counter in a linked list? what would happen if one left the counter out of the linked list? | |
I've been given a homework assignment in which I have to create a linked list, then store 25 random integers within it, after I've stored the values I have to find the sum of these 25 numbers, and then the floating point average of them. So for the most part … | |
I made the following functions for deleting a node of a singly linked list. 1. Can these functions be improved furthur? 2. Is it necessary to free the memory of the node that is deleted? nodep deleteByValue(nodep p, int value) { nodep temp = p; if(temp->data == value) return temp->next; … | |
i want to append a node in the linked list when i append this as struct node*p; p=NULL; append(p,1); where function is declared as append(struct node*q int num) i append three node, after this i call the function for counting the node, i get the total no node is 0, … | |
I have a linked list where the input is read into. The 2 types of input have to go into a queue. 1 queue for each type. I suppose that the output line of the linked list can be used to read it into the queue ? I know it … | |
hello friends, i have read a question about pointers and seems totally new concept for me .. how would you find out if one of the pointers in a linked list is corrupted or not? pointer is corrupted ??,, don't understand :( pls help your friend : sparsh | |
I think this has something to do with process scheduling. (1st process) Start 0// starts at 0ms Run 10 // runs for 10 ms Disk 0 // no idea what this does, but it takes 10 ms Run 30 // run 30 ms End // terminates (2nd process) Start 5 … | |
I'm trying to write a simple linked list program. The header files are compiling successfully, but when I try to compile my driver program to test the program, I'm getting an error. Here's my driver program: #include <iostream> #include "Node.h" #include "List.h" using namespace std; template <typename T> void fill(List … | |
I did a page for adding and viewing activities in a project. The table linked with that page has an UNIQUE constraint for the activity code. As a result of which when i add a new activity with existing Activity code, it is not accepted and gives a runtime error … | |
So, I'm using allegro game programming library. Before I move on to bigger and better things I wnat to get a handle on pointers. Specifically with things like structs, linked lists and maybe binary trees in the future. I posted a program that uses a linked list to keep tracks … | |
can someone explain me how it does not swap my nodes? void Library::sortList() { book *head = NULL; book *current = head; book *newBook; current = head; ifstream infile; infile.open("LibraryData.txt"); if (infile.is_open()) { while (!infile.eof()) { newBook = new book; infile.ignore(100,'#'); getline(infile,newBook->ISBN); infile.ignore(100,'#'); getline(infile, newBook->author); infile.ignore(100,'#'); getline(infile, newBook->title); infile.ignore(100,'#'); getline(infile, … | |
Can someone explain the code below? Is .next an operator in java that pushes the pointer to the next node in the linked list? Node E < -- type node? public E dequeue ( ) throws EmptyQueueException { if (isEmpty ( )) { throw new EmptyQueueException (”Queue under flow”) ; … | |
![]() | Hi, I am learning python coming from a C background and I am trying to understand how python lists work. I took a look at the built in methods, and I am wondering if they are implemented like a linked list. The reason I am wondering this, is because I … ![]() |
I am currently working on kind of multi-graph structure. The thing is that two graphs are needed for my application which span the same vertices but with two distinct set of edges (i.e., a multi-graph). The first graph is a binary search tree, while the second graph must be general … |
The End.