2,180 Topics
![]() | |
in an assingment, i have to implement a deque ( double ended queue ). the underlying datastructure is allowed to be arrays or linkedlist. only that im not allowed to use any prebuilt java api that does the above. (like the java.util.LinkedList api) implementing the above using doubly linked list … | |
Alright so my problem is I am getting an error that says undefined reference to all of my functions related to DoubleLinked, DoubleLinked<string> dict, dict.add, etc. If anyone knows why that would be great. Thank you. Oh and if i add () to DoubleLinked<string> dict then i just have undefined … | |
So on the page I have there is already an increment method in place to add to the count, but I need the option for the user to remove a count. A stored procedure is in place for the increment and Im assuming I can use another for the decrement … ![]() | |
If p is a pointer pointing a node to be deleted, then what's wrong in the following code: cout << "Do you want to delete this record? (y/n) "; if (getch() == 'y' || getch() == 'Y'){// Delete record. if (p == *ph){//If first node is to be deleted. *ph … | |
I've spent the better part of two hours going over my code line by line and I cannot find the problem for the life of me. #include "stdafx.h" #include <iostream> using namespace std; class NumberList { struct ListNode { int value; ListNode *next; public: ListNode(int val, ListNode * nextp = … | |
hi i works in a photo studio and we have two computers linked via direct LAN cable and it works fine. But the problem is, when i connect to the internet via wifi (alfa), it connects with the modem but internet dosent works. And when I disable the LAN, the … | |
If the prototype of my function is void sell_item(store **head,store **tail). In main i've passed sell_item(&head,&tail), where head & tail where both pointers of store(struct) type. Now I want to access the the content where head is pointing to. How shall I access it? Like *head->next??? But this is not … | |
Can't find out the error. #include <iostream> using namespace std; struct node{ int id; int *next; }; node * get_data(int ); node * get_data(void); void insert_node (node **, node **, node *); void display_data(node *); int main(){ node *head=0, *tail=0, *newPtr=0; newPtr = get_data(); insert_node (&head,&tail,newPtr); display_data (head); return 0; … | |
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 … | |
Hi, I am facing difficulty in removing a node from linked list. For example I am having four nodes having integers (10) (20) (30) (40). I need to remove second Node that is 20 from linked list. What i was trying to do is I am maintaining two pointers to … | |
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 … | |
My webmastertools showing *repeated domain url* (**www.example.com/www.example.com**) in the crawl error list. It is a 404 and I checked where it is **linked from** in WT. There were 5-6 urls in the list and checked all the internal links in each page, but no 404 error urls (*repeated domain url*) … ![]() | |
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 … | |
Hi everyone, I have the implementation for a linked-list based Stack. I believe the entire code is correct, but only the way I call the push and pop function mighe be wrong. Any idea how they should be called? Mine returns garbage: #include <iostream> using namespace std; typedef struct Elements … | |
i have two tables the following structures. CREATE TABLE `tblbranches` ( `branchID` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `branchCode` varchar(30) NOT NULL, `branchName` varchar(30) NOT NULL, `regionID` tinyint(3) unsigned NOT NULL, `branchAddress` varchar(400) NOT NULL, `cityID` smallint(5) unsigned NOT NULL, `countryID` smallint(3) unsigned NOT NULL, `branchContact` varchar(50) NOT NULL, `branchFax` varchar(20) … | |
I have been working on this assignment for a while now and I can't figure this one issue out. I was given four files, Name.java, SortableArrayList.java, NameListDriver.java, and SortableArrayListWithBubbleSort.java. The program is meant to take a text file with a list of names and sort them alphabetically. Part one of … | |
I am trying to read in from a .dat file, which includes a list of names a line of asterisks and a list of numbers, JUST the names in the file into nodes to be used in a linked list. All of the names will be before the line of … | |
Hi all, So I'm trying to learn how to do a hash table with separate chaining, but it is giving me several issues. The hash table I'm trying to make will hold instances of a class named Person and uses Person's data member phonenumber for the key. Currently, the main … | |
Hey guy I'm wondering if there is a tutorial or example code for a C++ RPG inventory system. I've surfed the website and I only discovered to make two classes, item and inventory and to use each of them for item's detail and holding the items in a linked list. … | |
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 … | |
Hi I am allocating memory space and adding nodes like this: CSprite* pNewSprite = new CSprite; // Create new sprite pNewSprite->iData = iChoice; // Attach data EnemyList->AddNode(pNewSprite); // Send to AddNode and also in the ::AddNode: void CLinkedList::AddNode(VOID* pData) { CNode* pNewNode = new CNode; // Create the Node pNewNode->pData … | |
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) { ??? } | |
Returns true if the string represented - by the object it is on the same string is represented by the object str. Otherwise false is returned. This system must write the recursion without using any loops. So I did it and it looks like this: public boolean equals ( StringList … | |
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 … | |
please help .i have written this programme just to enter data to a linked list.but it isnt working.cant understand where the problem is.how can i make this work and how can i make this programme evev better #include<stdio.h> #include<stdlib.h> #define NULL 0 struct linked{ char data[20]; struct linked *next; //pointer … | |
hey guys can someone help me with this i am stuck here where do i define a loop to add more nodes in the linked list or any other way to define nodes itslef in the code class Program { static void Main(string[] args) { List obj = new List(); … | |
Looking for an assist to modify this program based on the following info: Using two temporary linked list iterators and three for-loops modify a linked list with a perfectShuffle (); function (only modify the TODO line of code).. Here is the driver code: #include <iostream> #include <stdio.h> #include "linkedList.h" using … | |
class Program { static void Main() { Console.WriteLine("Roll Nos." + " " + " Names" + " " + "score 1" + " " + "score 2" + " " + "score 3" + " " + "Average\n"); Console.ReadLine(); LinkedList<string> Linked = new LinkedList<string>(); Linked.AddLast("maryam"); Linked.AddLast("ali"); Linked.AddLast("mahum"); Linked.AddLast("aliza"); Linked.AddLast("faizan"); Linked.AddLast("mehreen"); … | |
I'm not really getting the bigger picture with regards to linked lists. What needs to be done to link it? Also, there is an error with strncpy and for some reason on line 35 its not recognising struct trainset anymore and calls it a undefined variable. #include <stdio.h> #include <stdlib.h> … | |
I have been struggling with the principles of creating a client-server design where the server maintains a data structure that multiple clients can view and manipulate with various restrictions on which client can access which parts of the structure. I don't know what to properly call a system like that, … | |
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 | |
How to linked list take a array for input??? | |
How to deleting last node in linked list ? | |
I have a Code::Blocks project that includes a perl script which creates a c++ source file containing a linked list; the linked list is built by parsing special comments that may be included in all of the project's other .cpp files. The script is desinged to automate the creation of … | |
So this is basically what's supposed to be the outcome of my code: > 69:hw/05/src> javac WordOccurrenceCounter.java 70:hw/05/src> java WordOccurrenceCounter Reading the book... Getting counts from a TreeMap... Enter a string ('q' to quit): wealth wealth occurred 7 times. Enter a string ('q' to quit): poverty poverty occurred 10 times. … | |
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 … | |
hello i have a problem in cin characters this is my code //file LE.h struct nodetype; const int SIZE=81; typedef char dataline[81]; typedef nodetype *nodeptr; class LED { public: LED(); ~LED(); void insert(dataline lines); void Delete();//delete currnt line void move(int num); int cnt();// To Find Number Of Nodes. void list(); … | |
so I haven't used pointers to this extent for a few years so I'm a little rusty. I'll give a quick explanation on what the code is supposed to do, but from looking at my output I am messing up pointer arithmetic somewhere along the lines. I'm pretty sure it's … | |
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 … | |
So the program compiled but as soon as you enter a number for the length of the word it comes up with a segmentation error. Here is my code .h #ifndef GUESSER_H #define GUESSER_H #include <string> class Game; class Guesser { public: // Initialize the guesser for a game with … | |
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: … ![]() | |
Error 6 error C2143: syntax error : missing ';' before ')' c:\users\datacompress.cpp 214 1 Error 8 error C2039: 'putSymbol' : is not a member of 'std::basic_ofstream<_Elem,_Traits>' c:\users\datacompress.cpp 291 1 Error 9 IntelliSense: class "std::basic_ofstream<char, std::char_traits<char>>" has no member "putSymbol" c:\users\datacompress.cpp 291 12 #include <fstream> #include <string> #include <iostream> #include <ostream> … | |
import java.util.*; public class LinkedListDemo { public static void main(String[] args) { LinkedList link=new LinkedList(); link.add("a"); link.add("b"); link.add(new Integer(10)); System.out.println("The contents of array is" + link); System.out.println("The size of an linkedlist is" + link.size()); link.addFirst(new Integer(20)); System.out.println("The contents of array is" + link); System.out.println("The size of an linkedlist is" + … | |
Hello I have this problem where my text file is not read in properly to the linked list. It spits out only zeroes. Here is the code I have written. Thanks. include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; struct widget { double R; double S; int … | |
//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 & … | |
Hello, guys i have an irritiating problem in the following function: void Sort(Point P, Point &AT50, Point &AO50){ Point AT50_new, AT50_last, AO50_new; while (P != NULL){ if (P->Age <= 50){ AT50_new = new Member; AT50_new = P; AT50_new->next = NULL; // <--from here comes the problem if (AT50 != NULL) … | |
Hello, I'm a complete noob when it comes to .Net. I'm working on my college project. In my application there's a combobox/drop-down list. My requirement is as soon as user starts typing inside it, i.e. when text_changed is triggered it should retrieve values starting from that letter from a column … | |
What is complexity to insert, delete, and search in both sorted and unsorted linked list (single, double.. doesn't matter in general) ? | |
Hey I'm having trouble with a HW assignment, no need to give me the answer out right but any help would be appreciated! I'm just trying to search a linked list and find a node then delete it. Here is what I have so far: void deleteSong() { char deleteMe[sz]; … | |
[CODE] #include<iostream> #include<fstream> #include<string> using namespace std; struct phonenode{ char surname[15]; char initals[4]; phonenode *next; }; phonenode *start_ptr = NULL; phonenode *crrnt_ptr; void read_txt(){ ifstream ifs("test.txt"); char surn[15]; char inital[4]; phonenode *temp1, *temp2; temp1 = new phonenode; if (ifs.fail()){ cout << "ERROR" << endl; } while(ifs.good()){ ifs>>surn>>inital; if(ifs.fail()){ break; } … |
The End.