2,180 Topics
![]() | |
Problem: you are the owner of a new take-out restaurant , MCBurgers, currently under construction . you want to determine the proper number checkout station needed , so I have to build a java code using Netbeans to determine the optimal number of servers needed 1. the maximum waiting time … | |
Here is my code: slist.hpp [CODE]#ifndef SLIST_HPP #define SLIST_HPP #include"slist.h" #include"slistiterator.h" #include"slistiterator.hpp" template<typename generic> SList<generic>::SList() { m_size = 0; m_front = NULL; } template<typename generic> SList<generic>::SList(const SList<generic>& s) : m_front(NULL), m_size(0) { *this = s; } template<typename generic> SList<generic>::~SList() { clear(); } template<typename generic> void SList<generic>::push_front(generic x) { SNode<generic>* temp … | |
i am trying to move the node in the first item from the list and add it to the back of the list 1->2->3 becames 2->3->1 instead i get 3 1 2 [CODE] #include <iostream> using namespace std; struct nodeType { int info; nodeType *link; }; void createList(nodeType*& first, nodeType*& … | |
Hello. The problem with the following code is that when I read from a file after restarting the program and then try to display the contents, it goes into an endless loop. I hope that someone can point out the logical error hiding there. [CODE]#include <iostream> #include <windows.h> #include <fstream> … | |
[url]http://pastebin.com/uG54nJsv[/url] trying to make a linked list and C and for some reason it keeps crashing...the program is compileable if you'd like to see the memory error. I think my problem is with my pointer and dynamic memory allocation. -thx | |
guys help me in implementing "doubly linked list and circular linked lisct in c" . I know the logic but i am finding difficult to code. | |
pretty much here is a rough outline of what i have done [CODE]struct monster { int health; int armor; monster *nextaddr; }; int main() { int num; monster *pointer; printf("how many monsters do u want"); sscanf(%d, &num); pointer = (monster*)malloc(num * sizeof(monster)); //Here i need some kind of LOOP to … | |
Hi I am totally new to C programming (been using java for about 1 year) and have a question about pointers/linkedLists. So what i am trying to do is create a linked list and insert a new node as the head of the list...below is my code: The error I … | |
please single link list to made song list.. i dont know anything about that..please | |
Good evening. I've recently had an assignment to create a doubly linked list that is self contained. This means that the entire list is contained in a single class - the class acts as both the list and the node. I've completed everything and have gotten to my final task … | |
[CODE] #include<iostream> #include<time.h> #include<conio.h> using namespace std; class adclist { struct list { int data; list* next; }; public: void makelist(); }; void adclist::makelist() { list** table = new list* [10]; for(int j =0; j < 10 ; j++) table[j] = NULL; for ( int m =0; m < 10; … | |
How do I return the data in the last node from the RemoveTail function? Currently I have something like below.This is a basic doubly linked list. [CODE]class List; class Node { Node* next; Node* prev; void* data; public: Link( void* pData ) : next( 0 ), prev( 0 ), data( … | |
I was just playing around in python trying to get a basic sort of linked list working. I was able to make a simple linked list using an article I read online that looks like this: [CODE] class node: def __init__(self, value = None, next = None): self.value = value … | |
for removing the last element from a chain in my linked list? [code] Action *temp = head; //Action is my node while(temp != 0) { if(temp->link == tail) //tail is my last node { delete last; tail = temp; tail->link = 0; return; } temp = temp->link; } [/code] I … | |
Hello, I want to write a function which takes two linked list and check smaller The function CheckSmaller should return 1 if num1 points to a linked list which represents a smaller number than the number pointed to by num2 linked list. Otherwise, it returns -1. If both linked list … | |
[COLOR="Red"]can [/COLOR]you help me!! I have assignment that told me to write a function 'CheckSmaller' that takes two linked list as input arguments. These linked list contain numbers like this: num1->3->5->2->NULL (assuming that num1 is pointing to number 352) num2->4->3->9->1->NULL (assuming that num2 is pointing to number 4391) The function … | |
Hey, I Have a code to implement digital logic circuits , using linked-list. I have managed to build a simple program to work on 3 gates, which gives the user the option to choose between the gates and enter the kind of operation he wants and the values also. The … | |
hi, i created a linked list. it just adds values to the list called "source" and copies it to another list called "destination", it also deletes the values which is found in the source list and prints the source list again. link_list.h [CODE] #ifndef LINK_LIST_H #define LINK_LIST_H class link_list { … | |
i am new to programming............i just want to create a linked list program plz check for error for me [code] #include<stdio.h> #include<conio.h> #include<malloc.h> void insertAtEnd(int no); void insertAtBegin(int no); void insertAtPos(int no,int pos); template <span= id="IL_AD" class="IL_AD">Display</span>(); <span id="IL_AD5" class="IL_AD">struct</span> LinkedList { int num; struct LinkedList *next; }; typedef struct … | |
Good day! we have an exercise on how to create a list but i do not know how to do it without an algorithm. Can you help on what is the algorithm to create a linked list? | |
Hello, I'm exploring some technologies and JSP with JSF 2.0 and Primefaces seems really cool. I'm new to all of these, but I'm a fast learner. I wondering if I can create the web app I want withh JSP/JSF/Primefaces? Here's a basic description of the app: 1. Users log in … | |
Hi! I've got this structure struct *cell{int row,int column,int distance, struct cell *next}. By calling a function, I fill a linked list . The problem is that I cannot find how to delete the nodes that have the same row and column.Let me provide an example. Let's say that the … | |
Dear friends, hello to you all as this is my first thread - question to the forum. This is my problem, which is a school exersize: I create a linked list which contains three numbers r,c,d per node From this list I have to create a hash table htable[7] with … | |
When I was studying computer programming in college many years ago, I didn't imagine that our work could impact lives, particularly in a negative way. We've heard reports (mostly true) of death, dying, and destruction as a result of software problems, such as the time a plane flew right into … | |
Hello everyone. I've been trying to implement a linked list in C++. I found this implementation on the web, where they created a struct for the list's nodes. When trying to add a new node to the list, I get this error: [B]List.C: In member function `bool Linked::addNode(Point)': List.C:23: error: … | |
hi I have been working in this code for a while and I need to know what's wrong with it ASAP. here: [CODE]#include<iostream> using namespace std; class Node { public: int value; Node * next; Node(); Node(int); }; Node::Node():value(0),next(NULL){} Node::Node(int v):value(v),next(NULL){} bool AllPositive(next * h) { bool test = false; … | |
I'm supposed to define a function that removes all nodes with a specified value from a linked list. I have to use this structure: [CODE=c] typedef struct LIST { int Object; struct LIST *Next; } LIST; [/CODE] and here is the function I wrote [CODE=c]void LDeleteElem(LIST **List, int Elem) { … | |
this is a quick sort function that receives a singly linked list and a function pointer that is called before it has to be done recursive function. this is what i have so far [CODE]template <typename T> void quicksort(SinglyLinkedList<T> & A, bool (* before)(T &, T &)) { typename SinglyLinkedList<T>::iterator … | |
I saw the same thing I'm about to post on here earlier, but the difference is that I wrote the program, but it doesn't do anything save compile. The code's a bit sloppy, and I'm just not quite sure where to begin with the bugs. The actual assignment is as … | |
My assignment asks me to Implement a Linked List class with FoodItem as the objects to be inserted in the class, and implement a PrintList function member that prints the name of each food item in the list. Implement a SelectPrint function member that only prints the food item names … | |
Hello, im trying to implement a generic double linked list, and i have added just one function(insert). But im getting some errors. Here is the code: [CODE]#include <iostream> #include <cstdio> #include <string> using namespace std; template <typename T> class doubleList { private: struct Node { T info; Node *leftPtr; Node … | |
Hi I have to develop an algorithm visualization tool for my project. I divided my tool into these 4 modules below: [QUOTE]The tool will be divided into 4 modules: -The GUI -The Visualisation module -The Calculate module -The Compile module The GUI the GUI class is the class that forms … | |
Sorry about the double post but i dont know if you can delete posts? Anyway I need to have a circular linked stack where after 5 pushs the 6th push goes into front and replaces the data starting at front and going back. So theoretically if I put in a … | |
Hi all, So I'm currently teaching myself about hash tables. I'm doing a programming challenge where I create a hash table that stores instances of a class Person, with data members for name, phone number, and GPA. The table uses separate chaining to take care of collisions. The node I'm … | |
I am trying to write a dropout stack/queue using a Linked List, I have already done the code for Arrays but I am coming across a problem. I do not understand doubly linked list, specifically creating a pointer the previous. I believe I have done the push correctly (5 being … | |
how can one read from a file (.dat or .txt) using and linked list. ie. file 1 -> after reading from this list then user enters 1 for next which would print another file. file-> and so on | |
I want to create linked list of type LinkedList<LinkedList<Integer>>. I plan to take integer values from user (via console), create a linkedlist by adding the values. Create multiple such linked lists and then create a master linkedlist which will have individual linked lists as its elements. Example: User types 1 … | |
I am trying to add three functions to this code so that I can add an entire list at one time to another list instead of having to add individual elements one at a time. Here is what I have so far but it is not working. [CODE]#ifndef LINKEDLIST_H #define … | |
Here is the input.txt file that I have. [code]2 5 -2 3 1 2 4 0 1 2 1 0 [/code] These are 2 polynominals. 2x^5 - 2x^3 + x^2 + 4 and x^2 + 1 while <3,5> : 3 is the coefficient, 5 is the degree. I just can … | |
i am having errors when i compile this code such as: main_class.h(31) : error C2228: left of '.x' must have class/struct/union 1> type is 'float' main_class.h(31) : error C2228: left of '.y' must have class/struct/union 1> type is 'float' main_class.h(31) : error C2228: left of '.z' must have class/struct/union This … | |
Hello Friends I have This important question about implementing double link list I have done it but it dosenot work , please try to find what is wrong.. Thank you but I need this work queckly... [COLOR="red"]CLASS LINK LIST:-[/COLOR] [ICODE]public class LinkList { [I][/I] public class LinkedList<T> { private DoubleLinkList<T> … | |
I'm just wondering if someone could point me to some sources on linked lists. I'm trying to make it so the user inputs how many they want to add to the list and the list will stop after that amount. I'm just looking for some examples on it to help … | |
okay, so i do not understand the building of a link list although my professor has explained during my tutorial before. I cant get the concept of insertion a node and deletion of a node. i tried building a linked list myself which is mostly memorised from books. therefore can … | |
Hi i was given an assignment that ask me to create a simple object viewer. These are the requirements: 1. Display simple objects such as cubes, cylinders, pyramids, etc. 2. Objects should be able to rotate around all 3 dimensions. 3. There should be a parent object class from which … | |
I really have no idea where to start. Please only respond if you actually want to help. Not to name names, but [B]some [/B]people on here are just rude. Here is the assignment and any advice will be [B]greatly [/B]appreciated! 1. Write a program that allows the user to enter … | |
So here's the problem... my program is supposed to prompt the user to enter a number and use that value to determine what function the program should call via a switch block. Unfortunately, it seems that my program doesn't let the user enter an option and just keeps running the … | |
[CODE] while(temp != NULL) { if(temp->info.Name == cName) { temp->info.DiscountNumber = temp->info.DiscountNumber + 5; flag = true; } if(temp ->info.DiscountNumber > 25) { temp->info.DiscountNumber = 25; // prev->link = temp->link; // delete temp; //temp->link = first; // first = temp; } //cout<<"Discount is :" //<<temp->info.DiscountNumber //<<endl; prev = temp; temp … | |
Dear all , I need your help on this. I will say how I am thinking the solution and any help will be much aprreciated. I will denote the husbands with the following notations h1 = 11, h2=12, h3=13 and their respective wives with the numbers w1 = 21, w2 … | |
hi guys i need some help can you guys help me at deleting nodes I'm not yet that good in linked list and I can only delete the first node but I can't delete nodes in the middle and at the last help please I'm making a student database where … | |
Hi, I have an assignment where I have to implement a singly linked list of integers. Can you look at my pop front function below to see if it would work. I think it works, but I get this weird error whenever I test it. Also, how would I do … |
The End.