Questions tagged [implementation]

Deals with various issues of implementation.

Deals with various issues of implementation of functions, features, languages, etc.

2196 questions
0
votes
1 answer

Setting final value in a constructor

I have the following problem. I have two classes - one is the base class and the pther is inheriting it. So in the parent class is an abstract class and it consists three fields - String name, String adress and int age. However in my task it says…
dummydummy
  • 91
  • 1
  • 6
0
votes
0 answers

Method with interface as return type, refuses to return class with implementation

The method below is set to return a result implementing IResultSchema. I do that, but VS is complaining that it cannot convert the implemented classes (ResultSchema and EmployeeSchema) to the interfaces. It tells me to cast it, but…
Andreas
  • 117
  • 1
  • 1
  • 9
0
votes
1 answer

My code is not able to pass one of the test cases because it is producing a wrong value, which I can't find why. What could be the problem in my code?

Question - Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Unfortunately, not…
0
votes
1 answer

My c++ compiler is giving the correct output but the codeforces compiler for c++ is giving a wrong output

Question - A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). He has n dollars. How many dollars does…
0
votes
2 answers

Error in stack with linked list implementation

I'm trying to implement stack using linked list implementation. Its giving me "Segmentation Error". Please help me finding the error. This is my code: #include #include #include #define MAX 100 struct NODE { char…
0
votes
2 answers

C# error cs0534: does not implement abstract member get - although I do

I am new to c#. I got an interface that I need to implement, including this line in the interface: public abstract IEnumerable AllCards { get; } In my implementation I have this code: public IEnumerable AllCards { …
moran
  • 1
0
votes
3 answers

Identify library file/Source that contains native method implementation

How to identify library file that contains implementation of native methods ? Ex. public native String intern(); Where can I find implementation (source code) of String.intern() method ?
Prashant Bhate
  • 10,907
  • 7
  • 47
  • 82
0
votes
0 answers

binary search tree augmented to implement min and max operations in O(1) time

I'm trying to implement binary search tree operations MIN and MAX efficiently, in O(1) time. I see if BST is balanced, then these take O(lgn) in the worst-case; otherwise, O(h), where h is the height of the root of the bst, worst-case runtime. But…
0
votes
1 answer

Printing how many days one has lived so far in python

I'm trying to write a simple code which gets the birth date of the user and prints how many days so far they have lived. Although it's not that precise (I didn't add the month day conditions to determine how many days exactly each month includes),…
user15344209
0
votes
1 answer

Laptop specifications for implementation of blockchain

I have a question that I need to implement blockchain for tamper proof record so what laptop specifications would be required to implement blockchain?
0
votes
0 answers

c++ Stack Array implementation and display error

So in my assignment we're supposed to be creating a Stack class that creates a stack using array implementation for values of type double. Here's the header file: #ifndef STACK_H #define STACK_H class Stack { private: double…
Cyrus Lee
  • 27
  • 4
0
votes
1 answer

C++ Stacks with Array Implementation for Values of type double

So I'm trying to figure out how to make a Stack class with array implementation using values of the type double. Heres the full header file... #ifndef STACK_H #define STACK_H class Stack { private: double *stackArray; //Pointer to…
Cyrus Lee
  • 27
  • 4
0
votes
2 answers

design a test program: increase/decrease cpu usage

I am trying to design and then write a java program that can increase/decrease CPU usage. Here is my basic idea: write a multi-thread program. And each thread does float point calculation. Increase/Decrease cpu usage through adding/reducing threads.…
SecureFish
  • 2,391
  • 7
  • 32
  • 43
0
votes
1 answer

Can a C++ interface inherit from a class with full implementation?

I have a specific class structure in mind, though I feel like it could become a little messy when the project gets bigger. The general idea is the following: There is a class for all possible vehicles with basic implementations that do not change…
Eikeike
  • 23
  • 5
0
votes
1 answer

Difference between deque circular array and list implementation

From the research that I have done, it seems that deque is implemented either as a linked list or as a circular array. What is the difference in terms of performance between the two and why would one choose one implementation over the other?
trp
  • 35
  • 5