2,179 Topics
![]() | |
I have a file(myfile.txt) with the following lines, the records are semicolon delimited [I]Bon Jovi;Living + 2;EP;A+ Metal Maze;Aliotta Haynes Music;LP;B- Shore Brothers, The;Wipe my door, check;LP;C+ Bulman, Dane & Greg;Dane & Greg Bulman;LP;C- Calbert, Herb & The Mexico Brass;Rise;LP;A´[/I] . . . I want to write a c program … | |
so i have the following code, it inserts a number to a list and then i call my sort function which is below this function, the problem is that my sort function takes forever, is there a way i can implement my insert function so that everytime it inserts a … | |
Hello all, I've been fooling around with some code trying to teach myself somewhat about Linked Lists. I wrote this quick program that creates a random number in each node of a list and asks the user to guess the number. I have a quit choice that, when executed alone … | |
Please help me to create an output like this Enter a number: 1 Number you entered : 1 Enter a number: 2 Number you entered: 1 2 3 Enter a number: 3 Number you entered: 1 2 3 sample program please? | |
![]() | Hey I need help making a isEqual method in my singly linked class. The goal is to prove that both list have the same elements without necessarily having the same order. Now my method does call a different method in the node class, and it's job is to to search … |
![]() | I need to know how to create methods to compare two sets of singly linked lists. The only problem is that I can't put a linkedlist inside the method parameters. Please help [CODE]import java.util.*; public class SLinkedList { protected Node head; // head node of the list protected Node tail; … ![]() |
I've tried to make a [URL="http://en.wikipedia.org/wiki/Deque"]DEQUE[/URL] program. My book on data structures (Seymour Lipschutz) doesn't have an algorithm on DEQUES. Neither does [URL="http://www.itl.nist.gov/div897/sqg/dads/HTML/deque.html"]DADS[/URL] give a good description. All I heard was that it could be implemented better with two lists (one forward and one backward) & there are 2 types … | |
![]() | I need help with an add boolean method in a singly linked list, The only difference is that i start off with a dummy head. The method's job is to add non-repeating objects to the linked list. Please help: [CODE]public boolean add(Object newData){ Node current = head.getNext(); Node v = … ![]() |
Hi guys I have what I think is a really simple problem but I just don't seem to GET Linked Lists or at least how the nodes work. I have a class that implements these methods: public boolean add(Object newEntry); public boolean add(int newPosition, Object newEntry); public Object remove(int givenPosition); … ![]() | |
See I created a program that accepts three values from the user to be arranged as a linked list(ascending order). After it asks a number, it displays the content of the list. The output is like this: [CODE]Enter number: 6 List value: 6 Enter number: 4 List value: 4 6 … | |
Hey I am a student and i am new on the algorithm subject. I have been given a compulsory assignment that is to set up a program that have Liked list with Nodes. The problem is that i dont understand how to do this: - remove the first node - … | |
Hello. I am working on a data structures program that should be quite easy, but after programming in assembly language using mips, I forgot a little bit of C++ and can't remember how to do this. I've used my googlefu for at least 2 hours and still have this problem. … | |
Hello I am a new to C++ and have some questions. I have two classes called Point and Square like this: [CODE] class Point { int x, y; public: int getx() const { return x; } int gety() const { return y; } Point(int a, int b) { x = … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> void addToStart(); void addToEnd(); void printList(); void removeNodeAt(); void createList(); void menu(); int option; struct node { char cName [50]; int cNumber; char tDescrip [50]; struct node *next; }*newnode, *display, *temp, *list, *prev, *head, *tail; main() { do { menu(); switch (option) { case … | |
See I probably have the littlest knowledge on working with Linked Lists and I was thinking of creating a program that will accept three numbers which will be arranged on the list. However, I need to display the numbers everytime I input them, which I don't know how. My goal … | |
I wrote this program to make a linked list that holds a polynomial, which I then use in various operations. However, the program will not run at all. It builds correctly, but when I try to run it, it will either not come up at all, or it will come … | |
I was going through old programming tests from school and cam across this one that I got wrong and was wondering if anybody could help me out. We maintain our user list as an encrypted text file with the extension .LBE. We have a customer that is reporting that their … | |
hello all! i am working on a bank account type program where the user can add accounts delete accounts make deposits and so on. i have most of the code working but i am getting an error and i cant figure out whats wrong. if someone could steer me in … | |
Hello, I am asking about true syntax of the following:: I have a class name P and in header file (of this class) ------> [CODE] class P { public: P(); ~P(); void addItem(const int newItem); void deleteItem(const int Item); void showAll(); /** need to proper getter funct. of tail */ … | |
im solving a problem in linked list.how to check loop inside a linked list. i ve done implentation. always it goes without any error. but sometimes it encounters segmentation error. i dont find wny error or warning other than that.please try to help me figure out [CODE] #include<stdio.h> #include<stdlib.h> #include<string.h> … | |
I have been having trouble developing a function that frees all of the memory associated with structs of a linked list. Im not asking for a clear cut answer, just an idea or a function that can aid. F.Y.I. the linked list contains a head struct and a tail struct … | |
Hello, everyone! I made an account on this website because I'm having trouble with a particular program. I'm supposed to be writing a Polynomial class with a linked list to hold coefficients and an integer for the degree. I keep getting a fatal error LNK1561, though, and I don't know … | |
How to delete a node in a Singly Linked List using a pointer that points to the node? (Assume that you cannot traverse the list to find the previous node) -- With Regards Vishnu | |
Hey so I dont want someone to just show me the code, but I've been struggling to get this to work for hours. I need to write a program that finds all the words with consecutive vowels in them... this is what I have so far... -we are given a … | |
I am trying to make a circular linked list and I think I am not linking it properly in the middle area because I can print the last and first node, but not the rest... [CODE]#include <iostream> #include <new> using namespace std; struct node { int Item; node* Next; }; … | |
I'm trying to implement priority queue using a singly linked list, but the program is not running in the best way, n the display function is showing just first n last node's data , y??? [CODE]#include<iostream.h> #include<conio.h> struct node { int n,p,b; // Data members for getting Task no. ,Priority … | |
Hey again. Trying to add elements to a DList, this happens when I try to add the second car (500, Porsche). The whole insert algorithm sucks and am strongly considering trying to figure out a better one. This is what shows up in the console: Enter name of file with … | |
Hi, I'm new here so I'm not sure if this is the right place to ask for homework help. Sorry if it's not proper :) This is from my Data Structures class. I'm just about done with the assignment but it's giving me memory leaks and I'm not sure what's … | |
I can seen to fix my linked list, i tried looking into other code for help, but most of the linked list examples online don't even work and are out dated: [CODE]#include <iostream> using namespace std; class list { private: struct node { int data; node *next; }*head, *tail; public: … | |
this is my code .can any one please tell me why the program is not giving proper results?? [CODE]#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> //2d linked list major aasg#1 //structure type struct items { int id; //item no; char name[]; int price; char color[]; items *previous; items *next; }; //functions sort(); show_all(); … | |
Hey guys!!! I know these simulations are too much but.... still another one and I am havin some problems with that/// I have to create a file system simulation that has to understand these commands: cr a - create a new file named a, size ==0; rm a - remove … | |
Hello, I'm hoping you guys can help. I have a double linked list, and i am trying to add a bubble sort to it,I am really new to java, I've been able to do a bubble sort with great easy whilst using binary trees, but now i'm using a double … | |
After a few months working on another website, I am back finishing a list of coding tasks on my TAXA Wood Knowledge Base. One of the most important pages in the site is the one that lists (so far) over 15,000 different botanical names of woods. Each single name listing … | |
Ive been assigned a project where by i must find an MST via Kruskals algorithm. The problem I'm having is that I've been instructed to make a forest: "The forest can be implemented as a 2-D array of Boolean values (or as an array of linked list if you prefer). … | |
I'm new to c++. I was studying data structures and came to know Linked Lists Lately. We had a problem of finding an item stored inside a linked list and here's the code I wrote using Visual Studio to store and find an item. This code gives me a run … | |
i have written following insertion sort program for a doubly linked list completely by myself.The the sort function is giving me Segmentation error and i am unable to figure it out...Plz help me out and forgive me if the code is too wrong to handle.. [CODE] //insertion sort using doubly … | |
Hi everyone, I wrote something like that: [CODE] book *library = NULL; customer *service = NULL; do { printf("**********MENU***********\n"); printf("* #1 List of books *\n"); printf("* #2 Add book *\n"); printf("* #3 Search by title *\n"); printf("* #4 Search by category *\n"); printf("* #5 Search by author *\n"); printf("* #6 … | |
I have been asked to design a method splitMid that can be added to the LinkedList<E> class. This method should have the following header: public void splitMid(LinkedList<E> sublist) and should split the given list into two sub-lists of (almost) equal sizes. Suppose myList points to the with elements 34,65,27,89 and … | |
hi how can i deleting all linked list elements using ADT please i need the ideas ?? | |
Hay everyone I need help I have project in subject programming languages about make one idea on two languages c and java . I have made it in java but I couldn't in c this is the code in java [CODE] Class Link // Link.java // to run this program: … | |
Hi, i'm really stuck with this linked list and i feel tottaly out of my depth. Hopefully i can get it a bit clearer! what im trying to do is a print simulation with three priorities and im trying to make the linked list to act like the queue so … | |
Hello, Im very very new at C++, I have this assignment that I can't figure out, if anybody could me, I'll be very grateful. Create a List class with the following interface (at a minimum): bool addItem(Node&) //add an item to the list, return true on success Node* getLargestNode( ) … | |
I need to read in instructions from a file, then with those instructions, insert the names and scores below the instruction into a linked lists. I've tried using getline, and >> and I keep getting errors. Here is what I have so far: [CODE]#include<iostream> #include<fstream> #include<cstdlib> #include<string> using namespace std; … | |
[code]void display_list() { shoes_node *current_ptr; current_ptr = head_ptr; // move current_ptr to head of list if(current_ptr == NULL) { cout<<"\n\t\t\tNO RECORDS TO BE DISPLAY \n"<<endl; } else(current_ptr != NULL); { cout<<"\n\t\t\t ****************************\n"<<endl; cout<<"\n\t\t\t SHOES RECORDS \n"<<endl; cout<<"\n\t\t\t ****************************\n"<<endl; do { cout<<"\n\t\t\t SHOES'S ID : "<<current_ptr->idkasut<<endl; cout<<"\n\t\t\t SHOES'S BRAND : "<<current_ptr->jenama<<endl; … | |
[CODE]void search() { char id[12]; node *p = head; system("cls"); { cout<<"Search ID: "; cin>>id; } while ((p!=NULL) && (strcmp(id,p->id)!=0)) { p = p->next; } if(p==NULL) { cout<<"No such ID in our list"<<endl; delete p; } else cout<<"We have this ID in our list"<<endl; } void remove() { char id[12]; … ![]() | |
I've Just finished a program and it's taking various errors. Can you show me Where its wrong? [CODE]/******************************************************************** * Autor: Antônio Airton Cabral Neto * * Compilador: BC 3.1 Borland * * Ambiente: Tela de scroll do DOS * * Modelo de memoria: Small * * Data: 12/09 e 14/09 … | |
[CODE]void insert() { counter++; char id [12]; string title; string author; int year; char num_id[12]; borrow *newptr,*p,*q;//declare p = head; q = NULL; //counter++; newptr = new borrow;//declare cout<<"\nEnter your ID: "; cin>>newptr->id; cout<<"\nTitle of the book: "; cin>>newptr->title; getline (cin, newptr->title); cout<<"\nAuthor: "; cin>>newptr->author; getline (cin, newptr->author); cout<<"\nYear: "; … | |
Hi, I have linkend list in my program and I need to swap two elements. [CODE]typedef struct { int day; char month[10]; } LData; typedef struct element LElement; struct element { LData data; LElement *next; } typedef struct { TLement *head; } TLinked; [/CODE] Then some basic functions - initialization, … | |
I have a problem with this code too. right now I have a segmentation fault but before I couldn't get the correct maxValue. [code] int maxValue(node* head, int max) { node* p; if (head == NULL) { return(1); } else { p = head; max = p-> item; while(p != … | |
// Linked list Hi... Below is the codes that I wrote so far... everything is fine but just abit headache on when trying to read the data from the file...and it give me a weird things... my output suppose is like this [CODE]============================================================== No Name/Site Location Weight 01 ThunderStone Russia … |
The End.