286 Topics

Member Avatar for
Member Avatar for sedirox

I need help trying to figure out how to insert into a multi linked list. I know how it works with a linked list with only one piece of data but not 2 pieces with 2 pointers. Essentially what I want to be able to do is creat a multi …

Member Avatar for rioeduardo
0
1K
Member Avatar for ryan.maure

I am having a runtime error happen when I run my program and can't seem to figure out why. It is happenning on my insertion sort function. I also am going to have to do a selection sort with this and aany help would be greatly appreciated. Here is my …

Member Avatar for ryan.maure
0
293
Member Avatar for strizh

I'm having problem with passing argument to the linked list. I wait for user input then I parse this user input and put parsed tokens into dynamic array (char **c) After that I need to write ceratin user input into linked list (for example I need to pass c[1] to …

0
133
Member Avatar for Elixir42

I have written a working templated linked list that can hold a number of Types. Each of which are created with new before sending them to the InsertNode function. in Main: CMyType* pMyType1 = new CMyType; // Create a new MyType* pMyType1->m_iData = 5; // Hold a value LLMyTypes.InsertAtEnd(pMyType1); in …

Member Avatar for Elixir42
0
255
Member Avatar for erkanay

hi ! how can i do a one-way-circular linked list function that gives to me** merge 3 lists** such as struct node{ int data; node *flink; node *blink; }; void concatenate(node *&L1,node *L2,node *L3) { ??? }

Member Avatar for erkanay
0
170
Member Avatar for TrustyTony

Here is code, which you can play with before installing and using the [superior blist package from pypi](http://pypi.python.org/pypi/blist/). I did it as therapy after doing programming test answer using zillion of setters and getters. Motivation is basically to show why you should use properties after you need them and attribute …

0
311
Member Avatar for fize.tesfay

i need c++ code for simple linked list to implement algorith and data structure 1.create_node_and add to list 2.frst node delete 3.last node delete 4.delete node between first and last node 5. displaye the value of node in revese order 6. searching 7.exist

Member Avatar for fize.tesfay
0
337
Member Avatar for asad393

How should i implement the very basic singly linked list in C++, i am having a paper in just 20 days and i dont know a bit about this stuff,,, How to add data to it ,, as there is only one data item in single linked list and one …

Member Avatar for Gonbe
0
349
Member Avatar for umesh314

I am not able to see the desired output. Please let me know where I am missing a point. #include<stdio.h> struct node{ int data; struct node *next; }; void push_node(struct node *node, int data){ struct node *new_node = (struct node *)malloc(sizeof(struct node)); if(node!=NULL){ new_node->data = data; new_node->next = node; node …

Member Avatar for umesh314
0
108
Member Avatar for pinaka

can anyone tell how to make delete function for my program.......and how can i insert more than one value .....ie whenever i insert a value ........the program inserts and then exits.....Thanks in advance!!!! #include<iostream> using namespace std; class linkedlist { private: struct node { int info; node *next; }*head; public: …

Member Avatar for thendrluca
0
155
Member Avatar for nekoleon64

//Bubble.h #include <iostream> #include <fstream> #include <cstdlib> using namespace std; struct nodeType { int info; nodeType *link; }; class Bubble { public: Bubble(); //constructor //deconstructor //copy constructor //operator= (overloading the = operator) friend istream & operator>> (istream &infile, Bubble & mylist); friend ostream & operator<< (ostream &outfile, const Bubble & …

Member Avatar for VernonDozier
0
1K
Member Avatar for CodyM

Im getting errors that i don't understand how to fix, any help would be greatly appreciated! >C:\MinGW\bin\g++ -pedantic -Wall -Wextra A9COPY.cpp -o A9COPY.exe A9COPY.cpp:36: error: expected constructor, destructor, or type conversion before '*' token A9COPY.cpp:44: error: expected unqualified-id before "void" A9COPY.cpp:44: error: expected constructor, destructor, or type conversion before "void" …

Member Avatar for mrnutty
0
194
Member Avatar for BobA85

There is an unresolved external symbol in main.cpp when i try to call the insert function. I can’t find the reason why this is happening? Any help is appreciated. main.cpp #include "List.h" int main() { LList<int> number; number.Insert(1); } list.h #include <iostream> using namespace std; template <class T> class LList …

Member Avatar for acecode
0
356
Member Avatar for firras

If someone could help point me in the right direction, it would be much appreciated. My problem is merge sorting a list from a text file and outputting the sort into a different text file that the user chooses. The text file that's inputted is about a 20 item list …

Member Avatar for Ancient Dragon
0
704
Member Avatar for jongiambi

Hi im writing a fill-in-the-blanks program and I am stuck on how to delete a node from a liked list. I am suppost to follow this psuedocode to finish the program. I think I am close to a solution, can anyone point out what im doing wrong? The list already …

Member Avatar for Ancient Dragon
0
279
Member Avatar for johndolby

What are the benefits of using LinkedIn for business? How can I get traffic from this social networking website?

Member Avatar for DavidB
0
111
Member Avatar for CodyM

Trying to make my function that takes in an array and arrayLength and outputs a linked list equivalent to the array.Any help would be greatly appreciated! Node* array2List(int A[], int n) { Node* p; Node* q; q = NULL; for(int i = 0;i<n;i++) { p = new Node; p->val = …

Member Avatar for NathanOliver
0
105
Member Avatar for jamesmadison43

The goal of the program is to make a sparse matrix using circularly linked lists. basically its a matix what only has values at the locations entered, and the rest of the lactions are not defined. the question i have is the logic for the code. how would i go …

Member Avatar for jalpesh_007
0
271
Member Avatar for RozenKristal

import java.util.*; public class List { public static INode head; public List() { head = new INode(8); } public static void main (String[] args) { INode a = new INode(8); int data = a.getValue(); System.out.println(data); System.out.println(head.getValue()); } } And my Node class: public class INode { private int value; private …

Member Avatar for jalpesh_007
0
224
Member Avatar for Hojjat.Mojallal

Hi I've tried the code below to merge 2 linked list which f1 and f2 are the first nodes in the initial lists and the "first" is the first node in the result list. But it doesn't work! [CODE] node *merge(node *first,node *f1, node *f2,int n1,int n2){ int n=n1+n2; while(n-- …

Member Avatar for mandeepsukhwinderparmar
0
4K
Member Avatar for Niketh

hi all, I am working on C++ coding of fault simulation algorithm of a digital circuit . The first step involves parsing of netlist files. The sample netlist looks like - # Only 2,3 input gates considered ... INPUT(1) INPUT(2) INPUT(3) INPUT(6) INPUT(7) OUTPUT(22) OUTPUT(23) # comment here 10 = …

Member Avatar for hactor
0
565
Member Avatar for testie

Im having some trouble putting together a linked list implementation of a queue. I'm getting a segmentation fault, which I believe is due to my empty() function because in an attempt to fix my empty() function, I made it determine empty based on (current_size == 0) instead of (front_p == …

Member Avatar for dx9_programmer
0
756
Member Avatar for FUTURECompEng

Currently this method has a run time of O(N^2) and I am trying to get it to O(N). Any suggestion as to where I should start? public void removeAll(e removeNum) { node nodeToFind = this.find(removeNum); while(nodeToFind != null) { this.remove(nodeToFind); nodeToFind = this.find(removeNum); } } Thanks

Member Avatar for JamesCherrill
0
296
Member Avatar for kt9871

ran into a little snag with my code. i am trying to push the data of all the nodes in a linkedlist into a stack. problem is, i have no idea how to properly convert a node into a variable. Node current = list.returnHeadNode(); //other code... stack.push(current.getData()); my error lies …

Member Avatar for kt9871
0
406
Member Avatar for pattilupwned

Hello, I am writing a program that reads in data from a text file and puts it into a linked list. Certain variables are read in only if the "officeHeld" number is a particular number, otherwise the variable is set to 0. When I run this through Visual Studio, I …

Member Avatar for dx9_programmer
0
362
Member Avatar for FUTURECompEng

I am trying to input an int into the end of a singly linked list. I have already created the code to put a number at the end of the list but when I go to print it out, it only prints out (in my test class) the int that …

Member Avatar for jalpesh_007
0
304
Member Avatar for ownedbynothing

I do have 2 structures here. main linked list is the word. each node of the word list do have a meaning typedef struct node{ char word[20]; struct node2 *meaning; struct node *next; }word; typedef struct node2{ char meaning[100]; struct node2 *next; }means; My problem now is I can't add …

Member Avatar for Gonbe
0
1K
Member Avatar for SAM2012

I have a queue class code is given below: struct ListNode { ListNode(int value); int value; ListNode* next; }; ListNode::ListNode(int value): value(value), next(nullptr) {} public class queue { public: queue(); ~queue(); bool Empty() const; int Next() const; void Enqueue(int value); void Dequeue(); void DisplayAll() const; int getP() const; private: // …

Member Avatar for SAM2012
0
285
Member Avatar for superchica08

How to display odd and even numbers from a queue link list? hello everyone i really need some help right now on this program. what this program is supposed to do is copy 11 22 44 77 33 99 66 into a linked list that behaves like a queue. the …

Member Avatar for chaau
0
4K
Member Avatar for Brian_L

#include <iostream> using namespace std; class Lists{ public: void insert_head(int insert); void remove_head(); void insert_tail(int insert); void print(); Lists(); private: Node *head; Node *tail; }; struct Node{ int data; Node *link; }; int main() { Lists temp; temp.print(); return 0; system("PAUSE"); } Lists::Lists(){ head = new Node; head->Link=tail; tail->Link=NULL; } …

Member Avatar for JasonHippy
0
147

The End.