286 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; } … | |
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 … | |
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 … | |
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; // … | |
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 … | |
| 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 ![list1](/attachments/large/3/list1.JPG "list1") 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 … | |
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 … | |
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'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 … | |
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 … | |
Hi everyone, I'm facing problem in deleting a node in **del()** used in my program. Suppose, i've added a city as **Delhi**, and at the time of deleting, i type the name as **delhi**, the compiler gives a processor fault. But, i want it to display the line number **95**. … | |
Hi, I'm a new java user, working on a brute-force knights tour algorithm in linkedlist. The move function worked perfectly (for a while), I mean, the pointer could move forward, or backward if a wrong path was chosen. But all of a sudden, it returned me a stackoverflow error. i'm … | |
The hash table stores phone numbers and names, uses the names as the keys. The problem I have is when I use the terminal window to enter the names and numbers. The strange problem that occurs then is that all the names get the same phone number. But when i … | |
| import java.util.*; import java.io.IOException; import java.util.Scanner; import java.util.Random; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number, ran; Scanner sc = new Scanner(System.in); LinkedList<Integer> list = new LinkedList<Integer>(); ListIterator li; String line; Random random = new Random(); int pick = random.nextInt(150); System.out.println("Enter # of nodes"); … |
| So my java class is a joke, and we're expected to learn how to do our assignments via the web...I'm a hard worker, but I'm just not good at this. [Assignment pic](http://oi50.tinypic.com/aw3zx2.jpg) There's the assignment image. I think i got how to do the first part with the adding random … |
| Hey bros. I made a program that prints out random numbers in a linked list. I want to have the index number next to each of the random numbers in the list. I guess for example like: 1 25 2 123 3 56 ect. Here's m program so far, and … |
| hello everyone. I can't figure out how to create a random int that gets placed into a linked list. import java.util.*; import java.io.IOException; import java.util.Scanner; import java.util.Random; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number, ran; Scanner sc = new Scanner(System.in); LinkedList<String> list = … |
| Hey everyone. As always I'm sorry for my noobness when it comes to java, but I got a question I can't seem to find answered anywhere else on the web. I'm trying to make a simple program that takes whatever number the user types in, and makes a linked linked … |
| I have pretty much failed my class (4 weeks behind in an 8 week class that is currenlty at the beginning of week 8), but I am wanting to learn C++ for myself anyhow. I have visited http://www.cplusplus.com/doc/tutorial/ and gone through the tutorial, but cannot understand this assignment. I have … |
*i am trying to copy the value of ar2[10] //in main. has the value 1,2,3,4,5 in ar[10] //(in struct node). empty array so to copy the value iam not sure if i could use a strcpy for ex, strcpy(head->ar, ar2); //here is my code struct node { int ar[10]; //empty … | |
iam trying to store all the data in to a struct so i can change it later. //this data is in file abc 1 11 22 def 2 33 ghi 0 22 11 33 asd 2 i was planing on making a array of structs. so 1st line will have … | |
okay, i am trying to implement a program that cycles through a circularlly linked list to find different strings "assassins" and then eliminate the next person in the list. I believe that most of my code is correct with the exception of how I set up my linked list as … | |
Hello, I just need some help with linkedlists in C#, linked-list in C++ is kinda easy with pointers but im facing some problems in C# I read the examples provided on http://msdn.microsoft.com but I couldn't figure out how to link two different linked lists the efficitent way seems to be … | |
trying to create a insert method thats takes a char *name and int age. after than iam trying to insert in linked list. its seem to be working fine but if i have a linked lets say [1 2 3 4 5] and if i try to insert(2). i shoudl … | |
There's something wrong with the curly brace's can anyone see where please. //****************************************************************************************** //Header file for LinkedList.cpp. //****************************************************************************************** #ifndef LINKEDLIST_H #define LINKEDLIST_H //****************************************************************************************** //Declaring templates for classes. //****************************************************************************************** template<class Datatype> class LinkedListNode; template<class Datatype> class LinkedList; template<class Datatype> class LinkedListIterator; //****************************************************************************************** //Class: LinkedListNode. //Description: This is a class for the … | |
I have a GUI in which has a container for a JTable called 'listTable'. I want to populate the JTable with data stored in a linked list, using the AbstractTableModel. Basically, I have a LinkedList stored in Processing.java. It contains all the data retrieved from a text file. I created … | |
I am having trouble figuring out how to get a user inputted value into a structure I've created to make a linked list of stacks. The structure and pointer info before main() are: struct inforec { int item; }; struct node; typedef node *PT_NODE; struct node { inforec info; PT_NODE … |
The End.