The following code is a basic algorithm for hamming distance calculation, but due to the design of my application, it requires many times to use this algorithm, in order to improve application efficiency, I want to improve the efficiency of this algorithm, is there any appropriate methods? Assembly language possible?
Yes, well it depends which assembly language.
The most obvious thing is to use __popcnt64[^] to do 8 times as many popcnts in a cycle. Haswell can sustain 2 reads, a xor, a popcnt, an add and a fused sub/branch pair (hopefully the compiler will rewrite the loop logic) all together once per cycle, so that's pretty good.
You can also try the pshufb trick[^], the benchmark there shows it's a bit better. That takes more effort to make it really fast, doing as much vertical work as possible before doing a horizontal reduction and so on. May work better with AVX2, hard to say in advance.
Determine the incorrect statement below concerning the Union-Find data structure we
discussed in class (with union by rank and path-compression).
1. The union operation sometimes may not increase the height of
the resultant tree
2. The union operation can at most increase the height of
the resultant tree by one
3. The union operation always increases the height of
the resultant tree by one
4. The find operation sometimes may not increase the degree of
the root of
the resultant tree
5. The find operation requires two traversals f
rom node to root
I know this "isn't your homework" but we don't know what the Union-Find structure is as we weren't in the "class" where this was "discussed". If this was your homework I'd suggest getting additional help from your tutor if you need things explained, or arrange a study group with fellow students. But as this isn't your homework and we don't have access to the information needed to find a solution, there is nothing we can do to help.
I'm having trouble with the SPOJ problem below. While I'm new to C# I feel like I understand the concepts and am simply having trouble transferring it into code. More than anything the structure of the code is what I can't seem to picture in my head. To my understanding I need to find Brenda's optimal line first and then find out how best for Ann to react.
I'm at the point where I think I need less of a hint and more of a semi-solution so I can figure out where the gap in my understand is. Any help at all would be appreciated.
We have a project in which I am the head creator and we are in need of an algorithm. The algorithm must consist of multiple variables that will conclude the best possible option(s) based off of information collected by the user (if more details are needed please ask and I may be able to answer them based on the question). Can anyone help in creating the algorithm or direct us to someone who can help? Any guidance would be appreciated, thank you.
How do you expect us to ask you questions for details (not to say giving any answers) if you do not provide any details to start with...
What 'variables', what 'best possible option', what information collected', what 'user'?
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
I realize it was very general. I was more looking for someone who might be able to help with this and I can go into more details with that individual. I can explain a little more. We are working with some basketball coaches and part of the project is asking the question, how can a coach mathematically determine the best athlete for the program by the statistics each athlete provides while calculating what the coach needs to help their program? Also we would like to calculate the distance from the athlete to the program to give the probability of which player would be the best choice. I hope this provides a little more insight on the project.
I was more looking for someone who might be able to help with this
If you are trying to recruit a developer to write code for you then you are on the wrong site. Take another look at the link I posted in my previous response, which explains how to formulate a valid question.
Richard, could you be so kind and direct me to where I can find what I am looking for, rather then just a question? This is my first attempt and I don't want to be wasting anyone's time. I would appreciate your help, thank you.
Oops! I don't really think this is hacking. This is something which is not ilegal because if you ask operators for the unlock code, they will give you but sometimes they want you to use their service for a long time and they will delay your time. Perhaps, I want to start with modem and later learn the ones for phones that are shipped outside their country of operation since some of these phones come to my country and some become useless because the relatives of those who shipped the phones have no knowledge of this.
Unlocking with any means is not ilegal. Please check your laws and the meaning of hacking and compare them if they have a link. There is a calculator for that but it is online and I want to do this to help people who do not have internet connectivity always get the chance of calculating unlock codes.
Please understand this is not for my own selfish need. I just want to put my programming skills into use by helping those people. Unlocking is neither ilegal nor hacking.