2,180 Topics
![]() | |
[B]Beginner's guide to C++0x: Avoiding Memory Problems by Design of Ownership[/B] If you ever read any resources on C++ programming or object-oriented programming, you must have heard some rethorics like "inheritance is for the [I]is a[/I] relation, composition is for the [I]has a[/I] relation". Is that all? Is that the … | |
hey!! this is my first time to post question in this board. i learn a lots from this place. now , i really got a problem for this programming. anybody can help me!!!! i done "Add" part but i don't konw right or wrong and for "pass" i really need … | |
I would like to know how the isFull() function works for a Stack and a Queue, but by implementing the Stack as a dynamic array(without a predefined size) and implementing the Queue as a linked list. | |
Hey all! I'm new to the forum and a little wet around the programming ears so to speak. Anyway I have a question regarding Linked Lists. I know that typically a linked list looks like this: [CODE] struct Node { dataType varName; //data type and variable name Node *next; //points … | |
I have something that I don't know how to use the Pointer, this is my code: [CODE] struct node{ int data; struct node* next; } struct node* BuildWithLocalRef() { //give a list with: 1 2 3 4 5 //and your work is import this list in to Linked List with … | |
Hey, is there a way to replace a single characters by 2 characters in a string ???? This was asked to me at 1 of the interviews. I answered linked list, I mean, take each node as a character, so u can easily insert 2 nodes, if u want to … | |
| |
I just noticed yesterday that I did not have McAfee Security Center installed any more. (beat myself up enough, thanks, but feel free to express shock and dismay.) When I looked on the pc yesterday morning, there was only a McAfee scan app in c:\program files\mcafee. I have had McAfee … | |
Is it even possible to create a singly linked list using a function outside of main and then access it once you leave the function? pseudo: [CODE]#include //whatever needs to be included function{ \\create and link lists in this function } main{ funtion()//call function to create lists and link properly … | |
[code] class List(): def __init__(self,values=0): self.numb=values self.linker=self def add(self,values): self=self.linker self.numb=values self.linker=List() def show(self): while self!=self.linker: print self.numb self=self.linker [/code] In main call i want some thing like this [code] list1=List() list1.add(43) #i want to add numbers to liked list node like this list1.add(22) list1.add(938) list1.show()#Then retrieve it from the … | |
This is code for an internal forum, it works on my local server, but not the godaddy one i just purchased! phpinfo()s posted below: [CODE]<?php // forum.php :: Foro interno del juego.Version 1.0 define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/common.php'; /* Este foro esta basado en el PHPBBs … | |
I am required to create a function that returns a list of all instances of single characters in 'text' that immediately follow 'last'. For example... def follow_char(text,last): """ >>> follow_char('as we consider the operations', 'co') ['n'] """ I think I am required to solve this using linked lists but am … | |
[CODE]// this is program designed to create Cd data base #include <stdio.h> #include <string.h> #include <stdlib.h> //============================================= //LINKED LIST USED FOR CREATING THE DATABASE CD //============================================= struct CD_type_node { int CDnum; char title[20]; int CDcount; struct CD_type_node* next; }; struct Artist_type_node // to create a linked list of CD's { … | |
i have to impliment a chained hash table. in this prog i am using java.util.LinkedList. in one node of linklise i have to store two object-- 1)key value 2)value but java.util.LinkedList. provide add(object) method. that means i can not add two elements in one node of linked list. then how … | |
Hey guys, I'm very new to C++ and had a really quick question concerning linked lists. So I was wanting to pass a linked list to a function. I realize from another post that I need to put void function(Class * & head) to have it actually do something to … | |
Hi all, I just make a program and I get in trouble about set method.so anyone can help me? [CODE] import java.util.LinkedList; public class Polynomial { private LinkedList<Integer> coeff = new LinkedList<Integer>(); private int deg = 0; /* Constructs a new polynomial of degree zero */ public Polynomial() { } … | |
I have a homework question that instantiates 4 node pointers, *p, *q, *r, *t, and the first three have a number, 1, 2, and 3 respectively. I have to draw out (using 'blocks' and arrows) what the memory would look like when these lines of code occur: p->next = q; … | |
I have to write a code that accepts 5 grades and sorts them from smallest to greatest using linked list.This is what I have so far using examples from the book. #include <iostream> using namespace std; struct List { int value; List *next; }; int main() { int num, num1,num2,num3,num4; … | |
I have a homework question that simply shows a linked list of 3 elements (each one with a character in it, 'A', 'B', and 'C' respectively), with the 'head' pointer pointing at the first value of the list, and a 'current' pointer set to null. The question wants me to … | |
1) Let X be the length of the first linked list until intersection point. Let Y be the length of the second linked list until the intersection point. Let Z be the length of the linked list from intersection point to End of the linked list including the intersection node. … | |
Hi all, I have a simple code below [CODE]#include <stdio.h> #include <string.h> typedef struct { int apn_in_use; } bts_pdn_con_t; typedef struct _bts_pdn_con_list_t_slot { bts_pdn_con_t conn; struct _bts_pdn_con_list_t_slot *next, *prev; } bts_pdn_con_list_t_slot; typedef struct { bts_pdn_con_list_t_slot *head, *tail; } bts_pdn_con_list_t; typedef struct { int umsi; bts_pdn_con_list_t connections; } bts_ue_t; int funct(bts_ue_t … | |
.the program should use singly linked list of records.It should print he original directory then make some insertion and deletions then print the final directory. it should follow the steps 1. input initial listings such as name, address, and phone number. 2. input update records such as 'I' for insert, … | |
Hi, Recently I started working on a project (it's called 'fd') that needs to retrieve the current processes running. It is written in C using the WinAPI. I am running Windows XP SP3 and am using MinGW compiler with Code::Blocks. After much searching I found the PSAPI to provide the … | |
I am trying to use a linked list to read in data, do calcuations and then display it. I am new to using linked lists, so right now I'm only trying to display them to see if it works. [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <list> using namespace std; … | |
[CODE]// Program Dictionary // Proogram that uses linked list to maintain a dictionary #include <iostream.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <string.h> #include <ctype.h> class dict { private : struct node { char data[20] ; char m[100] ; int mcount ; struct node * link ; } *dic[22] ; … | |
Hi everyone, I want to implement an ADT Queue class (pointer base) use Template with following public interfaces: enqueue,dequeue,dequeueAll,peek,and size. I have 2 problems: 1.not sure how to dequeueAll which is removes all elements from the queue with Postcondition: size( ) returns 0 2.for dequeue and peek I need to … | |
Im having trouble implementing my own ordered linked list from scratch. [CODE] public class LinkedList{ Node head,tail; public LinkedList(){ head=tail=null; } public LinkedList(Node node){ this.head=new Node(node.num); this.tail=new Node(node.num); } public static void main(String[] args){ LinkedList list=new LinkedList(); list.insert(new Node(7)); list.insert(new Node(3)); } public void insert(Node node){ if(head==null){ head=node; tail=node; } … | |
I was trying to revise my linked list and implement it in C to check if there is a difference in performance... just as a sort of weird hobby.. In the absence of templates I'm trying to figure out how to pass a type as a parameter for this purpose. … ![]() | |
#include<iostream> using namespace std; class polynomial { private: struct p { int degree; float coefficient; p *link; }*head; public: polynomial() { head=NULL; } void getdegree(); void getpolynomial(int d); void display(); void addition(polynomial p1,polynomial p2); }; void polynomial::getdegree() { int degree1; cout<<"\n Enter the highest degree of your polynomial:"; cin>>degree1; getpolynomial(degree1); … | |
Hey guys, I'm writing a program for a class that basically is a menu that allows you to add people, delete people, change info, locate them by ID and last name, print the list, load the list from a file, and save the list to a file (in that order … | |
Not sure if I should out this here or in the php forum, I have a question that's probably gonna include both SQL and php... I'd like to add an image field to a table I have but I've never stored images in an SQL database before and I'm not … | |
Hi all, I am new in C programming, currently learning about linked list. I know that there is a lot of examples about linked list, but I decided to write my own code, to make me more understand. I managed to build a linked list, insert a new node after … | |
[CODE] struct node{ int value; struct node *next; }; void rearrange(struct node *list) {struct node *p,*q; int temp; if(!list || !list->next)return p=list;q=list->next; if(q) { temp=p->value; p->value=q->value; q->value=temp; q=p?p->next:0; } } }[/CODE] list is containing the integers 1,2,3,4,5,6,7 then the output is? also what's the meaning of p=list(as per me its … | |
Hi ,I am trying to implement stack with linked list ,but when I run it show up NullPointerException How can I avoid that with try and catch Thanks [CODE]public char pop() { try{ ListNode returnNode = top; top = top.next; } catch (Exception e){} return returnNode.value; }[/CODE] | |
I need to verify with some one if my code is right i have to submit it in 3 hours from now and any help will be welcome The instructions are: Using an appropriate definition of listnode, design a simple linked list class with only two member function and a … | |
I did some code to refresh my C. So many things have happened since 1987, but at least I started with ANSI instead of K&R. As I used the language so little, I think it is time to do some practise and even to learn some C++ to support my … | |
I really need help on my latest C++ assignment. The program was due a week ago and I'm still beating my head against a wall here. This is supposed to be a VERY SIMPLE linked list implementation. I have rewritten this dang thing countless times in as many different configurations … | |
please provide me doubly linked list all algorithms...... | |
[I]This is one idea for thread of some lessons learned with experience about asking wrong question and answers 'thinking out of box'. If there is need to have sticky, I suggest that this thread become sticky development thread and moderator can move the upvoted suggestions for next part in new … | |
Write a C program to implement Queues using Singly Linked Lists. Hints: The operations to be performed are 1. Insert Front 2. Delete Rear 3. Display or 1. Insert Rear 2. Delete Front 3. Display i solve but there are error: [CODE]#include<stdio.h> #include<conio.h> #include<alloc.h> // Structure of each node in … | |
When I run it starts with a junk value in the first node. I can't get the getValue function to work properly either I get error that says to few arguments when I try to call it in main. Also the minValue and maxValue doesn't output anything and I tried … | |
Hello I try to make one linked list to double linked list but i have some probems with this .Can somebody help me? This is yhe the linked list: [CODE]typedef struct ns { int data; struct ns *next; } node; node *list_add(node **p, int i) { node *n = (node … | |
I am having a compiler error that causes a screen to pop up that says break or continue. I know it is something wrong with my program but I am at a lost as to what it is. I was just trying to test the first function as you can … | |
please if any one knows howa to solve this problem Write a program that asks the user for the level n that he wants and creates the Farey sequence as a linked list of fractions of level 1, then extends it to level 2, 3,...n. Below are input/output samples: Input … | |
Hi all I am having a problem with my method in my linked list class to split linked lists into two sublists. The issue is that for some reason my first sublist has 3 more elements than the second sublist when I split a linked list with a total of … | |
what is wrong with my code?i cant figure it out. [CODE] #include<iostream.h> #include<stdlib.h> #include<stdio.h> #define MAX 50 struct Node { char judul[MAX]; char pengarang[MAX]; int harga; Node* nextPtr; }; Node* makeNode(char judul[], char pengarang[], int harga) { Node* newNodePtr = (Node*)malloc(sizeof(Node)); if(newNodePtr == NULL) { cout << "Out of Memory" … | |
what the wrong for this code : [CODE]if (head==NULL)//1 if the list is embty cout<<"NO element in linked list "; else if { if (head==tail){ ///2- if we have one node delete head ; } [/CODE] how i can write the other case if valid addrese if the addrese in … | |
Good Morning All, I have a query I need to do, but haven't been able to get it clear in my mind how to structure it... I have two tables 'members' and 'subs_track' they are linked by the 'mem_id' field in both There is a single record for each member … | |
hi there i am trying to build a linked list from read a file operation. this code only adds the first node to the list. the problem is i am facing with "error: request for member 'head' in something not a structure or union" error. i call add_Node function in … |
The End.