Gulshan
So should I first learn dsa... Or should i go with questions solving given on hackerearth ??
Roshan
Gulshan
Easy
Yeah.... It was having a easy tag....
Mary
hi , can anyone help me
Mary
#include <iostream>
using namespace std;
double celsius();
int fahrenheit();
int main ()
{
cout << celsius() << endl;
}
double celsius()
{
int f, c;
cin >> f;
c = (f - 32) * (5 / 9);
cout << c << endl ;
return c;
}
Ranmuni Imesha Udayanga
Ranmuni Imesha Udayanga
Can you send the C++ source codes within .h, .cpp, .pro and .ui file formats extensions for the weather calender updating system?
Anonymous
Ranmuni Imesha Udayanga
Ranmuni Imesha Udayanga
okey
Pest Control Service
Hi, I need some opinion on design pattern.
For an object with only few types (let's say 8) and only one instance of each type will exist, will you use a list[enum of each type as index], or static variable for each of them in the manager class
Dima
Yes, everything is possible in C
Anonymous
Everything is possible with any Turing complete language, but it easier to use some libraries with it
Anonymous
Rasputin
Guys; I have a question.
We are currently studying linked lists and we are doing singly linked lists at college rn.
Yesterday I realized I did my homework wrong.
The task was to rotate a singly linked list with n-Elements
wich would look like this. 3,2,1,20,10 and then when its rotated by example "2" it would look like this 20,10,3,2,1
i did it the "other way arround" which is wrong
Meaning it would look like 1,20,10,3,2 .
Can someone help me with the implementation.
What I tried was one pointer that runs to the end.
and dragging Pointer that is n Elements behind the other pointer.
Then I wanted to set the pointer on the end as the starting one and the dragging pointer as the nullptr. But, it doesn't work I have done something wrong.
Rasputin
void Rotate(TList& pList, size_t const n) {
TNode* pStart = pList;
TNode* pHead = pList;
TNode* pDrag = pList;
int i = 0;
int j = 0;
while (pHead != nullptr) {
i++;
pHead = pHead->pNext;
}
while (i > n && j < n)
{
pDrag = pDrag->pNext;
j++;
}
pHead->pNext = pStart;
pList = pHead;
pDrag->pNext = nullptr;
}
Rasputin
my code looks like this now, I know there is something really wrong. I have been debugging and I know the issue must be with nullpointers i guess. But I yet havent fully grasped the concept of pointers and linked lists 100 percent so its hard for me to find out whats wrong
Anonymous
Anonymous
Sorry for misleading
Igor🇺🇦
Name
Hello everyone
I have made a question on StackOverflow. Would be cool if someone could help me resolve my questions about debugging on Windows with Cygwin
https://stackoverflow.com/questions/65358253/debugging-multi-module-application-on-windows-with-cygwin
christian
Mary
Anonymous
Yes
christian
Yes
Oh I thought it was C
christian
F
if someone knows uml diagrams and software engineer please help
Makgato
Guys please i need example on how to create sockets for clients and server on Windows thanks in advance
Pest Control Service
Rifat
Hi, Can anyone help me?
Rifat
I was trying to solve a problem
Rifat
but didn't get expected answer
Sommy
Where can i get any professional C++ project with source code and documentation?
klimi
github
Lava
Anonymous
Finish him
Ибраги́м
Anonymous
/notes
Anonymous
/cbook
Anonymous
#best-book
Anonymous
#cbook
Sneha
Is there a better method to check if string has unique characters?...hash table, unordered set would provide linear time...and set would be nlogn,
Anonymous
Sneha
Sneha
kmp is used to search if a substring is present in a string right
Anonymous
Yess
Anonymous
That's what u're tryin to do
Anonymous
Right?
Alex
Sneha
No...to check if a string is unique like no letter has a duplicate
Sneha
Every character appears once if they appear
Sneha
Alex
to make it faster you can use array[256] and treat is as hash
Alex
Sneha
Okay, thanks guys
Sneha
Sneha
Since unordered set theoretically is O(1)
Igor🇺🇦
true for one byte char
If string is wide string it still O(1). Just that constant is pretty large. All this O(N) notation works when we're talking about infinite large numbers. In reality it doesn't always works
Alex
Sneha
Sneha
So it would make it linear in the worst case
Sneha
Eventhough insertion might be constant
Igor🇺🇦
Unordered_map of char will be significantly slower
rvp
hello everyone i need to write a c program like : For integers X and Y received from the user (assuming X < Y), write the program that adds all Germain prime numbers in the range of X to Y to an array and prints the elements in this array on the screen. Germain prime numbers are primes such that the number 2p + 1 is also prime. An additional string will not be used in this question. Otherwise, it will be evaluated as 0. also usage of user defined functions, continue and break is illegal. I've been this for 2 days but still i couldn't reach the right output. Here is my code, can someone check it and tell me where my mistake is https://codeshare.io/5v38mn
ברני
rvp
rvp