14 Discussion / Question Topics
Remove Filter 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 was writing a file copying program. Mind you this is an any file copier. That is, at this moment, this function can copy only text files but i'm trying to copy mp3 files, avi files, mkv files etc, which this cannot. Here is just the copying function. However it … | |
Okay this program is really pissing me off! After line 95, the member variable is suddenly getting changed (That is, the 2nd string). Even after looking at it for 3 hours, I've failed to crack it :( Please help me out guys! [CODE] # include <iostream> # include <cstring> using … | |
Here is a very simple code demonstrating how 'protected' is used [CODE]# include <iostream> using namespace std; class A { protected : int a; }; class B : public A { public : void f_1() // * { a = 10; cout << a; } }; int main() { B … | |
I've come across two questions from my previous years college test papers. I just couldn't solve them [LIST=1] [*][I]Define rational number as an ADT (abstract data structure)[/I] [*][I]Write a suitable C code to sort a finite set of elements where an element may appear a large number of times[/I] [/LIST] … | |
Okay, this time, i have to say it's a weird error. This code runs fine in Code::Blocks 8.02 but fails to run in my college compiler. I think my college compiler is the GCC Compiler (same as my home compiler) but in LINUX environment. Something like [CODE]vi sort.c cc sort.c … | |
I just received the MERGE SORT code from my friend, here it is [CODE]void sort_merge (int *array, int low, int high) { int mid; if (low < high) { mid = (low + high) / 2; sort_merge (array, low, mid); sort_merge (array, mid + 1, high); array_merge (array, low, high, … | |
Let's say we want to free the total memory used by a linked list in a program, I generally do it like this [CODE]typedef struct linked_list { int some_data; struct linked_list *link; }NODE; int free_memory(NODE * head) { NODE * temp = NULL; if(head == NULL) return 0; // FAILURE … | |
[B]Here is the sample program[/B] [CODE]# include <stdio.h> # include <stdlib.h> // COMPILER : GNU GCC COMPILER // EDITOR : CODE::BLOCKS 8.02 struct test { int data; struct test *link; }; void change(struct test *ptr); int main() { struct test *fresh = (struct test *)malloc(sizeof(struct test)); int some_data = 10; … | |
Suppose the user wants to input a string. The length of the string is unknown. I also don't want a character array of size 1000 or what so ever. I want the size of the character array increasing by 1 byte for every character entered. Here is a sample output … | |
I was making a DEQUE program utilizing two separate lists for forward and backward traversal. But what I think I've done is ended up making [U]two separate lists[/U], having same data but only their [U]order reversed[/U], thus wasting memory :'(. So what I want to know is this how a … | |
I just made a 'Hello World' program [code] #include<stdio.h> int main() { printf("Hello World\n"); return 0; } [/code] [code] exe file size = 15.5 KB Source file size = 79.0 B [/code] Then i made a data structure program (implementing stack, queue, deque) [code] exe file size = 21.9 KB … | |
During run-time of a menu driven program, I want the user to see what option the user has entered. Something like this :- [CODE][OUTPUT] . . . Enter Option : [1] <- [I]User given[/I] Press Any Key To Continue ... [_] <- [I]Blinking Cursor[/I] . . . [/OUTPUT][/CODE] After I … | |
[INDENT]Hello everybody, I just started learning C and decided to join this site. But as soon as I posted some of my code snippets here, immediately I got a stream of insults (thanks to [icode]conio.h[/icode]). But it's not my fault, I've grown on [icode]clrscr()[/icode] and [icode]getch()[/icode] (due to my experience … |
The End.