2,180 Topics

Member Avatar for
Member Avatar for Hanoon09

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 …

Member Avatar for masijade
0
129
Member Avatar for cml352

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 …

Member Avatar for cml352
0
209
Member Avatar for TinhornAdeniyi

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*& …

Member Avatar for TinhornAdeniyi
0
200
Member Avatar for AnkitPasi

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> …

Member Avatar for thelamb
0
326
Member Avatar for lochnessmonster

[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

Member Avatar for lochnessmonster
0
83
Member Avatar for pooran.c

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.

Member Avatar for Ezzaral
0
129
Member Avatar for lochnessmonster

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 …

Member Avatar for gerard4143
0
104
Member Avatar for tudorH

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 …

Member Avatar for tudorH
0
228
Member Avatar for katara
Member Avatar for JDCyrus
0
115
Member Avatar for Aequitas1

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 …

Member Avatar for Aequitas1
0
4K
Member Avatar for sairakhalid

[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; …

Member Avatar for sairakhalid
0
154
Member Avatar for divineelite

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( …

Member Avatar for divineelite
0
185
Member Avatar for JJHT7439

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 …

Member Avatar for JJHT7439
0
149
Member Avatar for LevyDee

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 …

Member Avatar for LevyDee
0
110
Member Avatar for BigDeveloper

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 …

Member Avatar for BigDeveloper
0
147
Member Avatar for cute cat

[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 …

Member Avatar for Red Goose
0
202
Member Avatar for L.sha

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 …

0
75
Member Avatar for indr

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 { …

Member Avatar for indr
0
224
Member Avatar for Ali5152

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 …

Member Avatar for NP-complete
-2
388
Member Avatar for wert21

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?

Member Avatar for vinayakgarg
0
86
Member Avatar for PythonNewbie2

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 …

Member Avatar for ~s.o.s~
0
93
Member Avatar for ambageo

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 …

Member Avatar for ambageo
0
191
Member Avatar for cuckas

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 …

Member Avatar for ambageo
0
338
Member Avatar for jeffcogswell

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 …

Member Avatar for max121
3
888
Member Avatar for J0shu

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: …

Member Avatar for jonsca
0
562
Member Avatar for htowa

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; …

Member Avatar for frogboy77
0
154
Member Avatar for vadalaz

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) { …

Member Avatar for vadalaz
0
113
Member Avatar for TSaunders84

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 …

Member Avatar for griswolf
0
114
Member Avatar for ELewis08

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 …

Member Avatar for Khaled Qawasmeh
0
339
Member Avatar for Atilly11

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 …

Member Avatar for daviddoria
0
121
Member Avatar for myk45

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 …

Member Avatar for griswolf
0
160
Member Avatar for DARK_BYTE

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 …

Member Avatar for JamesCherrill
0
380
Member Avatar for rcossy1023

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 …

0
66
Member Avatar for ace8957

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 …

Member Avatar for ace8957
0
269
Member Avatar for rcossy1023

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 …

0
59
Member Avatar for Plastix!!

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

0
47
Member Avatar for mangeshminal

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 …

Member Avatar for quuba
0
103
Member Avatar for ThrasherK

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 …

Member Avatar for thelamb
0
290
Member Avatar for muffle

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 …

Member Avatar for muffle
0
184
Member Avatar for Tiancailee

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 …

Member Avatar for Tiancailee
0
135
Member Avatar for mallak alrooh

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> …

Member Avatar for mallak alrooh
0
118
Member Avatar for gizmo7008

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 …

Member Avatar for gizmo7008
0
85
Member Avatar for Tiancailee

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 …

Member Avatar for Narue
0
128
Member Avatar for Tiancailee

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 …

Member Avatar for Tiancailee
0
184
Member Avatar for gpjacks

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 …

Member Avatar for Fbody
-2
111
Member Avatar for jsav

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 …

Member Avatar for Fbody
0
859
Member Avatar for Hyiero

[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 …

Member Avatar for Hyiero
0
735
Member Avatar for mbouster

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 …

Member Avatar for mbouster
0
2K
Member Avatar for ExCard

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 …

Member Avatar for vinitmittal2008
0
98
Member Avatar for hobokook

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 …

Member Avatar for group256
0
181

The End.