linked-list

Compile Error in VS2010 while testing LinkedLists

Hi all, I'm doing some tests to a LinkedList, that has two pointers: one point to the next item in the list and the other point to a random node within the list. Here is the code: struct Node { Node* pNext; // a pointer to the next node in the list Node* pReference; // a pointer to a random node within the list int num...

Linked Lists: Inserting at the end using last pointer.

I'm learning linked lists, and want to know whether the following program (basically InsertAtEnd function) I've made for inserting elements at the end of the list is correct. The basic idea is that *HEAD points to the first element of the list and *LAST points to the last element. This saves the time and calculations in traversing to th...

How to return a "complex" value using a webservice ?

Hello, I have a webservice that returns a complex value (this is a tree) public class DocumentTreeNode { public MyDocument Data { get; set;} private LinkedList<DocumentTreeNode> _children; public IEnumerable<DocumentTreeNode> Children { get { return _children.AsEnumerable(); } ...

Python; Linked list and traversing!

Hi! Starting some programming with python at school now, and I don't know how to proceed with this problem. Any thoughts? Input consists of integer separated by line breaks. Your program should submit them in a linked list, traverse the linked list and print the highest number. Something to take the first number, and do an action whic...

Get Java's list iterator to return something other than Object

I use Java. I already have a class for a custom object called "Subject". I have another class that only contains a Linked List of Subject objects. (called subjectsList) I wrote one of the methods (called "getSubject()") in the subjectsList class that is meant to return the Subject object at a specific index in the Linked List. To do t...

Implement linked list in php

How should I implement a linked list in php? Or is there any implementation builtin into php. I need to do a lot of insert/delete operations, same time I need to preserve order. There is no any SQL or extension. Thanks ...

Linked list not printing the list

I have made the following linked list which is not printing the list .The printrecord funtion is not working.Sorry for the long code. #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> struct student { char *name; int roll_no; struct student *ptr_next; }*ptr_this,*ptr_first; void PrintMenu(v...

array is of same type and linked list is of different type

In an interview when I ask the recent graduate students that what is the difference between array and linked list, the first answer normally is "In array you have same data types and in the linked list you can have different data types." When I told them to explain they will say that they have just read it somewhere or that they don't kn...

C#/.NET Not generic LinkedList is it present?

Hello, I wanna find something like linked list but non from generic namespace, is it possible ? Thanks. ...

Quick look up of Data structures.

Hi, can i get the link to Quick look up of data structures.. ...

how can I add xml attributes to jaxb annotaded class XmlElementWrapper

I have a class with a XmlElementWrapper annotation like: ... @XmlElementWrapper(name="myList") @XmlElements({ @XmlElement(name="myElement") } ) private List<SomeType> someList = new LinkedList(); ... This code produces XML like <myList> <myElement> </myElement> <myElement> </myElement> <myElement> </myElemen...

SharePoint doc with linked column - Cannot complete this action &RootFolder=* bug?

Stock Sharepoint 2007 I created a Doc lib and added a new lookup colum to a list. when I click on the linked column in the document allitems view of the Doc Lib I get a url that ends with &RootFolder=* and error page that says Cannot Complete this action. If I remove the &RootFolder from the url the page opens the expected item on th...

C++ Linked List Runtime Error: Unhandled Exception - Writing Location Violation

I am trying to build my own implementation of a linked list in C++. My code is compiling but apparently there is some issue with my pointers referring to invalid memory addresses. Here is my implementation: #include <iostream> #include <string> using namespace std; class Node { private: string _car; Node* nextNode...

Is there a way of using linked lists to simplify my Monte-Carlo code

Hiya, my code currently has three functions each producing a massive array of random numbers. Im wondering if there is a way of just having one function returning a linked list or multidimensional array to make it a bit neater: (copied from http://pastebin.com/Y5aE6XKS) #include <stdio.h> #include <stdlib.h> #include <math.h> #include...

Basic Issues with Linked Lists

I'm working on a homework assignment for CS1, and I almost have it finished but errors keep popping up in relation to a few functions I've tried to implement. The assignment is the classic addition and subtraction of big integers using linked lists. My issue isn't with any of mathematical functionality of the program, but rather getting ...

Adding and Subtracting Bigints Using Linked Lists

I'm almost done with this assignment, and it's killing me. This is my THIRD post about three different sections of this, and I'm honestly embarrassed that I'm struggling this much with the assignment. The assignment itself is to make a program that performs addition and subtraction of big integers using linked lists (and I'm slowly star...

SortedList - VS - List - VS - LinkedList

In my mind it was always there that List is basically implemented using LinkedList, while normal Array is implemented as Contiguous blocks. I always tried to use List because of it is made using Generic and also might have the power of Dynamic Memory Allocation. But I was wrong. Yesterday I saw the implementation of List using Reflector...

Intrusive list implementation for Java?

Is there any (well implemented) intrusive double linked list class(es) available for Java? Or should I do my own? Boost has it for C++: http://beta.boost.org/doc/libs/1_40_0/doc/html/boost/intrusive/list.html. Intrusive list is a container having (in this case) next and prev pointers within element, so typical list operations like repla...

Linked List in C

I am having some trouble running this linked list implementation (containing words as data). Problem is when I try to print the words (that I inserted) in the Linked List,I get nothing. What am I doing wrong, breaking my head over this? I hope it's not something silly. Anyway here's the code - typedef struct node { void *data; s...

How do I delete a node from linked list? c++

How can I delete a node (between two nodes) from a single linked list without passing any parameters to the class function? For example, I have a list of 6 nodes with one head node and i want to delete 2 of them (without prior knowledge of their address or position) from a class function, how would i do that? void WordList::deleteNod...