2,180 Topics
![]() | |
Return Nth the node from the end of the linked list. Time Complexity is O(n). | |
My second C++ lab, bit of fun if i do say so my self. Its a stack that uses a linked list in C++ alot of debugging stuff still in here, but I like the debugging output anyway. Sorry about the lack of comments and | |
In this program i had just extracted the modulo of the number given,and keep on adding it in linklist. later on,i reversed the link list and displayed the result. By:-- Anurag Pareek | |
This is a bit more tough than it sounds. well some one gave me this problem and I found this tricky not until I used recursion. | |
![]() | Unlike a balanced skip list, a probabilistic skip list uses random numbers to determine the height of each node rather than deterministic logic. The only real advantage of using a linked structure instead of an array based structure is in code maintainability. |
As part of a larger hobby project that I'm undertaking being a doubly linked list for 95/98/XP, this is the first in a series that I will be posting. Upon completion, I will have a complete application written in assembly for the Windows platform. Compiled with NASM | |
A singly (sp) and a Doubly Linked list class to create linked lists. Can be used to make dynamic arrays and could also be templated to work with any data type (this is old code and i didnt know how to at the time). Has been extremely useful to me … | |
Using the C++ Standard Template Libraries (STL) can be easy, once you know how to do it. No need to putz around with doubly linked lists anymore! Here is code showing how a STL list allows you to add, insert, remove, sort, splice, merge, display, and clean-out-duplicate strings. | |
I need to return the size of a doubly linked list and I am having trouble thinking of the logic to go about doing this. template <class T> int List<T>::size() const Returns the current size of the list; i.e., the number of data items currently stored in the list. Since … | |
Hi everyone, I'm dealing with a linked list that is supposed to be sorted. It's consisted of a series of strings which each of these strings are associated with 4 more strings. So, I'm looking for a way to sort this linked list with optimum way possible. I have some … | |
Hello all, I am trying to add two objects of integers. Object A: 92999 Object B: 22 My add method works when A is being added by B, but not the other way around because the amount of nodes is less. I should know how to add a node but … | |
Hello it's me again! So I've managed to create 4 linked drop down boxes like: Country : [===Country===|v|] Client : [===Client===|v|] Environment : [===Environment===|v|] System: [===System===|v|] And it's working fine with the codes written at the end of this post. Next step is I wanted a Table to contain 2 … | |
Hello. I am an international student trying to solve my assignment which requires to implement Circular Linked List. I asked my lecturer to check my work and she said that I solved it but actually still using the normal Linked List (Linear). She hinted me that I need to modify … | |
I am trying to create a program that will store user input into nodes of a linked list. I want the user to only have to input the data they wish to be stored, so I am trying to figure out a way to automate the naming of the new … | |
[B] plz i wont soulotion of my questions by codes : where list is the node pointer for the whole double linked list how i can : 1- add a node after the node that has 30 2- delete a node at the beginning of the list 3- delete a … | |
hey all, i am now making a gpa calculator. i am using 4 classes which form into seperate linked lists. one linked list is for the custom gui, and the other linked list is for the data list. i am using custom images for this program which i import using … | |
1. Write a C program to read a list of books from a file and create a linked list to store them. The purpose of this program is to keep track of the books kept in a shelf. The shelf is a three-tier shelf and each tier can store up … | |
Hi guys or gals , i'm in trouble with my class teacher, with in two days i have to finish my lab work .... i'm in need of c program using linked list my concept is 1. creating a linked list 2.Inserting a number in front of it 3.Insert a … | |
after a lot of fussing, my code finally compiles properly. but once again, its not calculating the things i want. PROBLEM: doesnt calculate "scores entered by user" doesnt calculate "highest max score" doesnt calculate "lowest min score" as far as the scores entered by user... i was hoping this.. if … | |
ok. im pretty much done with this small program my teacher asked us to write. my problem is: it wont give me how many scores there are above average. it keeps giving me 0. i dont get it. maybe im overlooking something? i think something is wrong in my [color=#33FF33]// … | |
Here is what I got and maybe this will help. In example 1 you are on the company page which shows that company and some information that is needed for this company. The bar that runs about in the middle accross that will have links for CONTACTS - JOBS - … | |
1. Write a C program to read a list of books from a file and create a linked list to store them. The purpose of this program is to keep track of the books kept in a shelf. The shelf is a three-tier shelf and each tier can store up … | |
Hi, I want to add a new node at 5th position in a single linked list in C++.Please help me with this..as am new to linked list. | |
hi all, this is my first time using JAVA. i know other programming languages, such as, c++, PHP, Assembly. this is a basic personal schedular. for saving the data i am using a custom designed linked list, and for the gui i am using custom gui. the program runs fine … | |
So this is my first time on here asking for help but I do visit this forum every now and again when I am taking a programming class. I am trying to get my doubly linked list to work correctly. Also I am having issues with parsing an input file. … | |
i have already posted here about my linked list facebook program and i have anoter problem with the function : void cancelFriends(int id1, int id2, PersonList* allPersons) here is the structs again : typedef struct Person { int id; char* name; struct PersonList* friends; } Person; typedef struct PersonList { … | |
irealy dont know how to sort my liked list . i should sort it by friends and by name . please try to help me...... i dont know even how to start. here is my structs : [code] typedef struct Person { int id; char* name; struct PersonList* friends; } … | |
One of my clients has links from their website to the Linkedin profiles of their execs as well as the Linkedin Company Page. Additionally, each of the exec's linkedin profiles list the corporate URL as does the Linkedin Company Page. My question is this, if a company has this type … | |
a function that take as input two linked lists of character and determines if the first is a sub list of the second. for example if the first list 'e'-->'l'-->'l'and the second is 'h'-->'e'-->'l'-->'l'-->'o' the function returns true | |
hello people, I have a problem in sorting linked list according to id number of student in secondary school system ,the code is not working .can any body help me please ?!! Here Is my code. [CODE] void sortbyID() { struct school *pre; struct school *move; move=head; pre=move; move=move->next; while … | |
hello. In my project the students are added into two levels(1 & 2) each level has it's own linked list so if you choose to add a student in level 1 it will be added to list1, if you choose to add him in level 2 it will be added … | |
hi , I'm trying to store linked list in a file . I opened a file with extension txt but when I opened it to read it . It was encrypted does anyone know why?? | |
So we were in class today and my professor said that, while iterating through a linked list you can use the ++ operator to get the next node. Here's an example linked list... [code] #include <iostream> using namespace std; class Node { public: int data; Node * next; }; class … | |
I'm very confused. I'm suposed to expand this pointer-based list class in this program by setting ListItemType to int then adding methods to find the smallest number, the largest number, and the average of the list. Before I added the findLargest function the program would compile but, when ran, gave … | |
Hi im working with linked list and i have to implement a function that deletes the duplicates of a number. for example if given 2 7 1 7 12 7 then the result should be 2 7 1 12 here is what I have: [code] #include <iostream> using namespace std; … | |
I am writing a simple program for managing the final grades of students. The program first read original data from a file called "final.txt", and create a linked list to store the imfornation in memory. The format of the orginal data is "Class_Character Seat_number Computer_grades Laboratory_grades". There is only data … | |
My friend and I are in the process of build a MUD in java. We took Java in highschool, he is continuing with computer science in his college, I am not. I am surprised how much I do remember, but there is a lot I have forgotten. Previously my friend … | |
hello, got a quick question regarding stack overflow (I honestly don't know if this is more suited for a wxWidgets forum, once you see what I mean, but I figured I'd try here first). I was tweaking my linked list class and testing it in a testing harness program I … | |
I have a text file that (partial snippet) looks like the following: Bugs Bunny Jr. 1234 1001.01 Porky Pig 2345 1002.02 Its format is a name (including spaces) is 20 characters, then 4 digit number, a space, and a number thats not a set number of characters. I have to … | |
Hey guys appreciate u can help to do this: Write a program to implement linked lists to handle large integers. Since we cannot store big integers in any of the primitive types, the only way is to manage each digit as a node in the linked list. Take care that … | |
I am trying to insert a node before another node in a doubly linked list and I have been trying to do for awhile, but I still can't get it =/. I keep getting error whenever I try to display the list after I insert in a new node. Please … | |
Hi there, this is my first post here so please tell, if im doing something wrong. Ok so heres the the struct [CODE] typedef struct _CMD { char nome[100]; char arg[100]; struct _CMD *prox; }*CMD; typedef struct _sCMD { int cont; CMD inicio; CMD fim; }*sCMD;[/CODE] The function i use … | |
Hi, I'm currently trying to create a linked list to use with a BSP Tree, however the root node keeps on losing its' values as soon as I leave the function. The code is quite extensive, so I'll try to post the relevant sections. This is the header file. [b]OpenGLView.h[/b] … | |
Please someone helps me with this question I must submit the answer tomorrow. The program is not working properly as is suppose to ; I am not getting the result shown below. Write a program that accepts numbers from the user and stores them in a linked list called allnum … | |
I am working on a basic linked list program and i seem to be having problems with the getline() function. I try to input data in to my struct: [CODE] cout<<"\n\nPlease enter the name of the student: "; getline(cin, temp->name); cout<<"Please enter "<<temp->name<<"'s class: "; cin>>temp->grade cout<<"Please enter "<<temp->name<<"'s GPA: … | |
I'm trying to traverse to the end of a linked list, but I get a segmentation fault when my while loop checks to see if the "next" pointer is null. Any suggestions on how to perform this check without causing a segmentation fault would be greatly appreciated. | |
I am constructing the control flow of the program. I am reading the bb.ls file and in that file I will search for ‘b’(branch instruction), if ‘b’ is found I create a newnode and store the node count and store the address of the next node( linked list). My doubt … | |
hi guys, hopefully somebody can tell me what i'm doing wrong here: i'm trying to put together a copy constructor with this linked list class, but i just cannot get it to compile: [code] #ifndef LINKEDLIST_H #define LINKEDLIST_H //*************Include Statements************* using namespace std; // for cout //***********END Include Statements*********** class … | |
Hello, I wrote an add method but for some reason it does not add more than 3 values. Could anyone tell me why? here is my method: [ICODE] public void addValue(int value) { IntNode cur = head; IntNode prev = cur; IntNode t = new IntNode(value); if (value <= cur.data){ … | |
[code] #include <iostream> #include <cstdlib> #include <cassert> using namespace std; struct node { int info; node *link; }; void insert(node *first, node *here, int x) { node *temp = new node; temp->info = x; if (first == NULL) { first = temp; } else { here->link = temp; } } … |
The End.