2,180 Topics
![]() | |
Hello, for a school assignment I was supposed to write an insertion sort algorithm for a doubly linked list. As the feedback system of this particular course is rather weak (actually non-existent) I would like to ask you for your honest opinion about how well this is implemented, what could … | |
this is my latest class assignment, i would really appreciate some assistence with my pseudo code to help me in the right direction. my code skeleton is provided at the end of this post. Deque A double-ended queue, often abbreviated deque and pronounced deck, is an object with the following … | |
Hello Friends, i am having a hard time coding for **8 Puzzle using DFS** (depth first search). my code uses linked list but apparently its "not ok". so can any1 please help me by sending me a documented code (so i understand). I am kinda on a deadline. -thank you … | |
Hi programmers, i need to have a code to produce a round robin algorithm. Can you help me?? The requirements are that it must have: A menu system with the options (1 input data manually-if option 1 is selected a)to read data from file, b)to enter data by hand, 2-automatic … | |
My Program is about Directed Graphs. It reads a list of edges like : `25 589` , and puts 589 into the adjacency list (a linked list) of 25. My input file has about 5 Million such `v w` edges, with about 800K nodes/vertices, for each of which there will … | |
kindly someone to tell me one advantage of a stack backed by a dynamic array over a stack backed by a linked list and one advantage of a stack backed by a linked list over a stack backed by a dynamic array... ![]() | |
/*can you help me with this this is double linked list that helps you to sort integer value in increasing order I hope I will get answer thank you*/ #include<iostream> using namespace std; struct Node int data; Node *next; Node *prev; }*head,*tail; void main() { head = NULL; int n; … | |
Hello all, I am implementing linked list programs in C. And for that i want to know more about Self Referential Structure in C. If anyone knows more detail information about it then please tell me. I am having one example here which helps you to understand more clearly what … | |
![]() | I am trying to read a file and follow instructions based on its contents, add them to a linked list. I have the all the file handling written but am still having trouble with pointers and linked lists. The instructions from the input file would go like this i n … |
**Quick Sort Using Double Linked lIst** This code does not sort the data in first approach.When i enter the sorting option two to three time then it sort the data.I think the problem is in recursive part.I am trying to sort the linkedlist in the same way as we done … | |
hello. I have to use a function in my phonebook program to sort the names alphabitcally here is what i have done so far.but what's wrong with it? void showAllContacts() { char t[40]; list *head; if(head == NULL) { puts("There are no contacts to display!"); } else { printf("\nAll contacts:\n"); … | |
and i get error with error C2451: conditional expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal void system1::search() { cout<<"Enter ID to be Searched: "; int data_search; cin>>data_search; nodetype *current = head; while(current != NULL) { if(current->ID == data_search) { cout<<"\n----Linked List Linear Search Result----\n"; cout<<"ID: "<< current->ID <<endl; cout<<"Name: "<< current->NAME … | |
Data structures to be used The program should use two distinct structure-types to store the students’ scores: the 1st type used for keeping scores of 4 quizzes while the 2nd type is used to keep the scores of 2 exams. A student can have either quizzes (if Engineering student) or … | |
hello, I'm new to c and i need to put the following string from a file into a linked list : music;artist;1,2,3,4;2015 i also need to put "1,2,3,4" in an array but only the numbers. I would really appreciate your help. Thank you ![]() | |
My Objective is to define a function, with a pointer to a list of elements of the structure I created as the first parameter, a C-character string (of type char * ) as the second parameter and one of the of the two values,num or name, from the above enumeration … | |
what is differences between linked list and array | |
Given functions in Figure 3, write a program in C++ to insert nodes in a linked list in ascending order. Values for node will be entered by user. Your answer should include code to find previous node when insertAfter(node *previous,node *newNode)is called.  Please someone tell me how im … | |
I'm working on this code for class, I am not expecting anyone to do my homework but help would be appreciated. Nodes are confusing for me and my professor did not explain well. The errors I am getting are where I declare the functions, I dont know the nodeType(?) that … | |
Hi. I'm learning C++ by myself, so I'm a noob, also i'm a mad scientist :P I'm trying to use a doubly linked list with polymorphism, and got a problem. Here is my code: #include <iostream> #include<string> #include<cstdlib> #include<cstring> #include<sstream> using namespace std; // node class template<typename T> class nodeType … | |
Hi I am having trouble trying to get my add and remove function to work. We had to create an ADT List using array's. It keeps giving my program errors any help would be great, I think my problem might be my second part of the add function where it … | |
#include<iostream> #include<conio.h> #include<string> using namespace std; struct node{ char data; node * next; }; void queue1(); void queue2(); void queue3(); void queue4(); void concatenate(); node * firstnodeptr1=NULL; node * lastnodeptr=NULL; node * firstnodeptr2=NULL; node * firstnodeptr3=NULL; node * firstnodeptr4=NULL; node *finalfirstnodeptr=NULL; int counter1=1,counter2=1,counter3=1,counter4=1; void main(){ char ch; do{ cout<<"enter the … | |
I was reading this example of Priority queues and have several questions. http://matrixsust.blogspot.com/2011/11/basic-priority-queue-in-c.html #include<stdio.h> #include<malloc.h> void insert(); void del(); void display(); //How exactly do structs in structs work? Do you need to do anything special with them? Is this a //form of a linked list? Which part of this is … | |
Write a function ListSplit that will split a circular list containing an even number of nodes, say 2k, into two circular lists each of which contains k nodes. The function should have three parameters and should work so that the function call ListSplit(list,sub1,sub2); will create new lists pointed to by … | |
Let x be a node in SLL. Write a C++ function to delete the data in this node. Following this deletion, the number of nodes in the list is one less than before the deletion. Your function must run for O(1). | |
Hello All, I am writing c++ program to insert, sort, display and merge two linked lists. Insertion, sorting and display functions are working fine but merge function is not working as expected. Please help me correcting merge function. I have used One header file "intSLLst.h" and two cpp file "intSLLst.cpp" … | |
I need some ideas on my array of struct implementation. This is what I have in my structs. I plan on making SHAPES an array because I will have multiple SHAPES. Each shape will have multiple x and y coordinates. Because of this I'm not sure if should make a … | |
hi! i have written a code of linked list using character array to add and display data, it can add data but not display. can anyone help?? thanks. #include<iostream> using namespace std; class node private: char data[30]; node* next; public: char showdata() { return data[30]; } void setdata(char c[40]) { … | |
/ I want to debug this code but I can't? How can I debug it in console application using System; using System.Collections.Generic; using System.Text; namespace BucketSort { class BucketSort { public static void Sort(int[] integers) { //Verify input if (integers == null || integers.Length <= 1) return; //Find the maximum … | |
Hi I have tried to implement Linked-List data structure and i was folowing a guide but i have an `error` in line 12 in `contactlist.h` I have included `contact.h` properly but still not working :-/ contact.h #ifndef CONTACT_H #define CONTACT_H #include <iostream> #include <string> #include "contactlist.h" class Contact { private: … | |
Hi all; I’m a newbie here and it looks as if I might be able to get a bit of advice on what I think should be a fairly simple project that would actually have some value in my real world if I managed to get it working. I have … | |
Hi. I'm learning by myself data structures with c++ but i got stuck Here's my code: #include<iostream> #include<cstring> #include<string> #include<sstream> using namespace std; template<class T> // node class class nodeType { public: nodeType(); nodeType(T); ~nodeType(); nodeType *next; nodeType *previous; T data; //string getkey(); string Id; //void borra_todo(); void imprime(); // … | |
What is wrong with my java code in Eclipse? I have 4 different classes and it won't give an output. the problems are in the scorestest with the print function and in scores with the nodes. Please help. ScoresTest: public class ScoresTest { public static void main(String[] args) { // … | |
So I have writen a program that takes a linkedlist and shuffles it randomly using mergesort algorithm. The problam I'm having now is that the original list loses elements after the shuffle, and after som checking with some outputs it seems that it always one of the extra lists who … | |
Hello guys, I've wrote a symbol table creator that uses hash function to determine the position of the symbol in the table and a linked list approach for the storing process in the table. And to the point. I've known myself for doing easy problems the hard way(and my teachers … | |
In the Following code, Function Delete_item is not working properly. it only works when we use break; statement... if some can do it without using break; stetement then please share and eplain the method... #include<iostream> using namespace std; struct node {int info; node *link; }; class list {private: node *head, … | |
HI I donot understand where to start . I need ideas and help. void InsertList(c4735list *destinationList,c4735list *sourceList,node *startNode) { //=====================not implementd yet } this fn inserts source list into destination list.the nodes are inserted after the startnode in destination list.source list should be an empty list after this operation. the … | |
Hello! Recently I've been working on a project which requires an API, the user supplies a function pointer which returns a specific value, this function needs a list of string arguments, similar to what you may find in the "main" function. I first thought maybe some sort of linked list … | |
//here's a singly linked list program with functions. However, I don't kbow how to add function #7 wherein //the position of the maximum number in the list should be displayed.. :( import java.util.Scanner; class Node { protected int data; protected Node link; protected int next_num; public Node() { link = … | |
Hello programmers! I am working on a program that checks if a user's input is a palindrome (in this case, the input is a string). I am using a custom class template "stack", that is a constrained version of my custom class "List", which is a linked list class template. … | |
Hellp programmers! I am working on a program that uses two objects of a custom class template List [which is a linked list, with each item pointing to the next] and concatenates them. Initially, I need to input numbers into my main function, so I have two sets of while … | |
Hi all, I was just playing around with some ideas about optimizing a core piece of my library: the run-time type identification system (RTTI). What does that have to do with compile-time string concatenation? Well, the whole point of the RTTI is to provide information on the type of objects, … | |
how a single linked list can be sorted by swapping the pointers?? | |
Hello below is my code for a program that reads in integers rom keyboard input and creates two polynomials from that input and then does some maths functions on them. I've got the addition working, having trouble with the multiplication though. Any help would be appreciated. thanks import java.util.*; import … | |
![]() | Hello All. Been playing around with some linked dropdowns. It seems to be a recurring theme here on DW, so I thought I'd offer this up as a possible solution or for discussion, to see how it could be improved. The premise for this set of linked dropdowns is that … ![]() |
Say I have this definition: #define SIZE 2000 typedef enum { TRUE, FALSE }Boolean; typedef struct{ char jobTitle[30]; char jobDesc[255]; char jobLoc[255]; float salaryMin; float salaryMax; Boolean isAvailable; }jobInfo; typedef struct cursorNode{ jobInfo jobRec; int next; }HeapSpace[SIZE]; typedef struct hnode{ HeapSpace heap; int Avail; }*VHeap; typedef int List; typedef struct{ … | |
hey all im a relative noob with progaming if i could get some help i would be greatfull this is homework but not the whole assignment thank you all So when i run this it works fine if i type in the name of the first node but none of … | |
The program should insert a node that is a sum of next 2 nodes stdin: 2->7->4->9; stdout: 2->11->7->13->4->9; The program returns a segmentation fault,I'm not sure what seems to be the problem. void insert(Node * list){ if (list==NULL) { return; } for(; (list->next->next)!=NULL ; list=list->next){ Node* new=(Node*)malloc(sizeof(Node)); if(new == NULL) … | |
#include<iostream> using namespace std; struct node int data; node*next; }; node*head=0; void input_at_end(); void display (); void del(); int main(){ for(int i=1;i<=3;i++){ input_at_end(); display(); } del(); cout<<"\nafter deleting"<<endl; display(); } void input_at_end(){ node*temp; temp=new node; cout<<"enter data"; cin>>temp->data; temp->next=NULL; if(head==NULL){ head=temp; } else{ node*temp2; temp2=head; while(temp2->next !=NULL){ temp2=temp2->next; } temp2->next=temp; … | |
The system is able to find grade for each course based on final marks, calculate GPA, Calculate CGPA. Methods (menu); i. Input matric_number, name, coursecode, credithours, semester, final marks for each subject. You may use text file ii. Calculate GPA and CGPA for each student. iii. Search a student record … | |
Okay. This weeks 'problem' is that I need to simulate a game. I have to make two singly linked lists which will contain a name of player, his attack (double/float) number and his defence number and so on for as many players as the user inputs. The point of the … |
The End.