I'm writing a simple program to figure out how Linked List works, but for now I'm stucking. I don't know which line cause the error or I had a mistake in thinking. I run my program by my hand and it works fine. But when run, it gets error at all choices, didn't work or runtime error. Please help me figure things out! I think the code explains itself. Thanks everyone who give my thread a look. BTW, I'm using Pelles C 8 IDE on Windows 10. #include <stdio.h> #include <stdlib.h> #include <conio.h> struct Node { int data; struct Node …

Member Avatar
Member Avatar
+0 forum 3

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, but on the surface it seems like a simple problem. Unfortunately, I've found ways to make it complicated for myself and I've been slowly teaching myself how to simplify it to manageable levels. For example, one of my top design goals is that each client should have a local copy …

Member Avatar
Member Avatar
+1 forum 10

I have an assignment on the data structures directed graph and I have got this question but I did not understood what exactly it needs Here's the question : There is a list of nodes and edges like A B B C D E F B The first line says that there is a link from a node called "A" to a node called 'B". This means for a A to be a useable, it relies on the resource B. Write a program that should work with any amount of nodes and any amount of links between them. Where you …

Member Avatar
+0 forum 0

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. The error: head undeclared, first use this function. The code it is talking about [CODE]void node::insertNode(int id, string name, double average,int *array) { node *newNode; //a new node node *nodePtr; // to traverse the list node *previousNode = NULL; //the previous node cout << "test 2"; //allocate a new node …

Member Avatar
Member Avatar
+0 forum 3

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 is to have this: [CODE]Give a number: 2 Display List: 2 Give a number: 3 Display List: 2 3 Give a number: 1 Display List: 1 2 3[/CODE] I'm not actually familiar with how linked lists work so far so any explanation that would give light to this concept is …

Member Avatar
Member Avatar
+0 forum 2

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 the right direction on how i could fix it that would greatly appreciated. the error im getting is: C:\Users\kevin jack\Desktop\hume\prog1>g++ -o prog1.exe acctListMain.cpp acctListMain.cpp: In function `int main()': acctListMain.cpp:69: error: expected primary-expression before '.' token acctListMain.cpp file: [CODE]/********************************************** * Prog 1 Kevin Jack * * **********************************************/ #include <iostream> #include <iomanip> …

Member Avatar
Member Avatar
+0 forum 1

i would like to check a size of data structure of a file in another file . how can i do so using fopen????

Member Avatar
Member Avatar
+0 forum 1

Hi all, I'm having a problem here!! I've attended a lecture on Implementation of stacks in c++ using arrays and it wasn't really hard to understand, but now I'm supposed to know how to Implement a stack using linked list, that's the problem. help please?:confused:

Member Avatar
Member Avatar
+0 forum 2

I am writing some code to simulate a football tournament by comparing several teams on several parameters. I need to be able to knock out teams, edit some stats mid simulation, and be able to easily access individual teams data, what structure would I be best using? I had thought possibly vectors but I am very new to c++ and could do with some advice. sorry if something similar has already been answered. cheers Dan

Member Avatar
Member Avatar
+0 forum 6

Hey , i am new to data structure and specially Graph . And i was going through a problem for finding the best path [url]http://www.codechef.com/JULY11/problems/LOKBIL/[/url] And couldn't think something usable. SO , if u guys help that will be a good start of me on this site too. PS i know contest is live so all i want is how to start , and little hint for program . Thanks in Advance !!

Member Avatar
Member Avatar
+0 forum 3

Hi, help please! I have a struct containing an array of pointers to structs containing Binary Search Trees with nodes containing structs. ... <*sigh*> I hate C soo much... put work wants it to be in C. I can set the struct of BST's just fine, and keep it around, and I can set the innermost struct values. My problem is keeping those innermost values once I'm outside the function that puts them there. [CODE] void function(Struct struct, int i, int k) { Array array; array = InitArray(); array->key = k; struct->array[i] = &array; } void otherFunction(Struct struct, int i, …

Member Avatar
Member Avatar
+0 forum 1

Hi. I've a BST created for an address book application for my term project. When inserting into the BST, I insert items sorted by their first names in ascending order. The thing is that the user should be able to display the BST in the ascending form of last names & birthdays as well. My solution to that is inserting items from the BST into a new BST in the sorted form of last names in ascending order. Besides that I've no idea about how to sort by birthdays. So I've coded something for sorting by last name. It uses …

Member Avatar
Member Avatar
+0 forum 9

Hello everyone, I have created my own random text generator with a custom method, no Markov chains included, and now I would like to try it on a different text corpus that is larger from that of NLTK's and I wanted to know which Data structure should I use in order to make the code work faster since additional text files will surely make the code a painstaking procedure to execute. My algorithm is as follows: 1- Enter the trigger sentence -only once, at the beginning of the program- 2- Get the longest word in the trigger sentence 3- Find …

Member Avatar
Member Avatar
+0 forum 2

I have to [B]sort around 12GB of integer data[/B] which is kept in a file. I have a [B]1 GB RAM[/B]. How should I do it? The problem is I cant read whole of data together and store it in a vector because it goes out of memory bound. Which sorting algorithm should I use? I have to do it quickly. When I googled for this I got a line on the page [URL="http://en.wikipedia.org/wiki/Sorting_algorithm#Memory_usage_patterns_and_index_sorting"]http://en.wikipedia.org/wiki/Sorting_algorithm#Memory_usage_patterns_and_index_sorting[/URL] saying "combine two algorithms in a way that takes advantages of the strength of each to improve overall performance." It suggests using quicksort on small data …

Member Avatar
Member Avatar
+0 forum 12

Hello all, I have a question: What are the advantages & disadvantages of the circular linked list compared with: a. Usual linked list b. Doubled linked list Although the implementation of the usual list functions & the circular list functions are similar…when do we have to use it?? or in which situations the circular list is better than the usual list? :rolleyes: Thank you, ;)

Member Avatar
Member Avatar
+0 forum 5

Is there any difference between a sorted link list and an ordered link list? If there is any difference please show it by giving an example. Thanks

Member Avatar
Member Avatar
+0 forum 5

0 down vote favorite I'm trying to figure out how exactly to use stat() to capture information about a file. What I need is to be able to print several fields of information about a file. So.. [CODE] #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> using namespace std; int main() { struct stat buf; stat("file",&buf); ... cout << st_dev << endl; cout << st_ino << endl; cout << st_mode << endl; cout << st_nlink << endl; cout << st_uid << endl; cout << st_gid << endl; cout << st_rdev << endl; cout << st_size << endl; cout << st_blksize …

Member Avatar
Member Avatar
+0 forum 1

The End.