guys i have this assignment about luhns algorithm and i cant seem to know where to start (i am very weak in functions and arrays) , if anyone can help me out with the start of the i would be very thankful then later on i will be disscussing my doubts. thank you in advance. Credit cards use a system of blocked numbers similar to the ISBN. The first digit of a credit card number is the Major Industry Identifier (MII) and identifies which group issued the card. The next block of numbers is the issue identifier. Including the MII, …

Member Avatar
Member Avatar
+0 forum 2

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 be improved, made more efficient, etc? Thanks in advance, Marcel #include <iostream> using namespace std; class elem{ public: int value; elem* prev; elem* next; elem(int e, elem* ptr1, elem* ptr2){ value = e; prev = ptr1; next = ptr2; }; }; class list{ private: elem* first; elem* last; int length; …

Member Avatar
Member Avatar
+0 forum 4

the program is about Blob<T>, where shared_ptr<std::vector<T> > as its data members. be noted that the real problem here is about shared_ptr of my own version (simple one) but atleast (should) worked with the Blob<T>, which is the std::shared_ptr did, but not with mine. [Error Msg](http://postimg.org/image/krwflmyhx/) the error msg above is produced through object that's being constructed by initializer list. if the object being constructed through default constructor then being append by push_back() function. the program compile but crashed. just after the shared_ptr::operator*() executed.yet I still unable to figure out the problems. T& operator*() const { return *p; } T* …

Member Avatar
Member Avatar
+0 forum 7

Hello everybody! I'm trying to display the result of addition of vectors. But Builder shows the error after compilation (line 29). What should I change for in my code in order to find the problem? Thanks in advance. #include <iostream.h> #include <iomanip.h> #include <conio.h> class CVector2D { public: CVector2D(double x0 = 0, double y0 = 0) :x(x0), y(y0) { } double x, y; CVector2D const operator +(CVector2D const& vector2)const { return CVector2D(x + vector2.x, y + vector2.y); } }; using namespace std; int main() { CVector2D a(3.0, 5.8); CVector2D b(7.3, 8.8); CVector2D c = a + b + CVector2D(3, 9); …

Member Avatar
Member Avatar
+0 forum 2

Hye, I have started to read and implement Cache Oblivious Btree on RAM. Starting with the Weight Balanced BTree by Arge and Vitter. The Deletion algorithm explained says that after deletion of a leaf an ancestor will get unbalanced so to merge the ancestor with neighbor and split if the weight goes above the max range. "Deletions. Deletions are similar to insertions. As before,we search down the tree to find which leaf w to delete. After deleting w, some ancestors of w may become unbalanced.That is, some ancestor node u at height h may have weight lower than (1/2)d^(h-1). As …

Member Avatar
Member Avatar
+0 forum 4

hi, i need to past *.x 3d model file into vb6 script. can someone recomend some comprehensively teaching online redaction about? it will be good if there could possibly find way of puting multiple objects in. ex three to see the regle. thanks, i will publish the resultats, for next discussion when passin through... :\

Member Avatar
+0 forum 0

I am trying to implement a priority queue with an unsorted array and hit a wall when I received a Segmentation fault:11. I used gdb and got the error: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x00000001000017fa in Item<std::string>::setKey (this=0x0, k=3) at PriorityQueueArray.h:27 27 void setKey(const int k) { key = k; } (gdb) backtrace #0 0x00000001000017fa in Item<std::string>::setKey (this=0x0, k=3) at PriorityQueueArray.h:27 #1 0x0000000100001b58 in PriorityQueueArray<std::string>::insertItem (this=0x7fff5fbffb00, k=3, x=@0x7fff5fbffaf8) at PriorityQueueArray.h:48 #2 0x0000000100001430 in main () at PriorityQueue.cpp:50 My code is: ` // // PriorityQueueArray.h // Assignment5 // // Created by Danielle Crowley …

Member Avatar
Member Avatar
+0 forum 1

How should i implement the very basic singly linked list in C++, i am having a paper in just 20 days and i dont know a bit about this stuff,,, How to add data to it ,, as there is only one data item in single linked list and one pointer, how to accesss and remove data...

Member Avatar
Member Avatar
+0 forum 5

Do you need to implement a class in order for an object to access the class's functions/methods? When should you implement a class? When shouldn't you?

Member Avatar
Member Avatar
+0 forum 2

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 need some idea how to correct this program. Though I think I understand the concept, my implementation is wrong. My program only prints the orignal string and does nothing with it. [CODE] public class ArrayStack<E> implements Stack<E> { protected int capacity; protected static final int CAPACITY = 1000; protected E S[]; protected int top = -1; public ArrayStack() { this(CAPACITY); } public ArrayStack(int cap) { capacity = cap; S = (E[]) new Object[capacity]; } public int size() { return (top + 1); } public boolean isEmpty() { return (top < 0); } public E top() { if (isEmpty()) throw …

Member Avatar
Member Avatar
+0 forum 1

[CODE]#include<stdio.h> int main(){ int a=5,b=10; a=a+b-(b=a); printf("\na= %d b= %d",a,b); getch(); }[/CODE]

Member Avatar
Member Avatar
+0 forum 1

Hi, I need to develop a C# console application which implements stack as a circular queue. I've written the code to use stack as a simple queue. [CODE]using System; public class Stack { private int[] theArray; private int topOfStack; public Stack() { theArray = new int[10]; topOfStack = -1; } public bool isEmpty() { return topOfStack == -1; } public void push(int data) { if (topOfStack < 10) { topOfStack++; theArray[topOfStack] = data; } } public int pop() { if (!isEmpty()) return theArray[topOfStack--]; else return -1; } public void display(int flag) { if(flag == 0) //display outStack for (int i …

Member Avatar
Member Avatar
+0 forum 1

The End.