Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have read that Binary Indexed Trees are very efficient. But I couldn't anything more than that. If anybody knows about that, please share your knowledge.
This solution will help you. There are direct algorithms available and this explanation is a good one I could see
This is how the author of the blog has described Binary indexed Tree
We often need some sort of data structure to make our algorithms faster. In this article we will discuss the Binary Indexed Trees structure. According to Peter M. Fenwick, this structure was first used for data compression. Now it is often used for storing frequencies and manipulating cumulative frequency tables.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to use an algorithm for stereo processing images (or frames – as I intend to use it for a real-time application written in C/C++) and I was thinking about: Census transform algorithm and matching cost calculation based on Mutual Information as my best options, but as far as I know, Census transform doesn’t give quite as accurate results as Mutual Information, and Mutual Information is more expensive.
Which one would be more suitable for my case?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Why are most data compression algorithms created with C++ or Java. Why not use javascript or even ruby? Is it dependent on the file type you are trying to compress such as text,video or even audio files?
If you need to compress data, it is probably because you have a lot of data; as such, the performance of such algorithms is pretty important, and other things being equal, a compiled language typically performs better on the kind of low-level data manipulation such algorithms employ than an interpreted one.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
(Okay, so my previous question is on hold as being too broad, so I'm narrowing it down here.)
I'm looking to take part in algorithmic programming contests, and a lot of problems hinge on the use of specialized data structures which are extremely good at a certain operation - for example, Fenwick trees allow calculation of prefix sums of a list of values in logarithmic time.
What is the preferred way of implementing such data structures in modern C++ (i.e. using C++11 features)? Is it possible to use STL algorithms and containers instead of writing structs and coding every operation by hand?
I'm looking for Fenwick trees, segment trees, treaps and some other data structures often useful in IOI-style contests, but general strategies are more than enough.
there's an implementation of a fenwick tree here: http://www.algorithmist.com/index.php/Fenwick_tree
It uses std::vector as the underlying container.
arguably the method increase could be written in terms of std::transform or std::foreach.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
i need some help in deciding which data structure i should use. i'm going to create a patient information system of a hospital just like a simple student information system.
i have studied Arrays, Linked Lists, Trees, Stacks, Queues and Graphs. i think it would be too simple with Array. should i use linked list?
how will i store all the fields into it? a Linked list stores one item of data at the moment, no? my requirements are to add information, search them by their ID and be able to delete through ID as well.
any ideas? thanks
my requirements are to add information, search them by their ID and be able to delete through ID as well.
Seems like an std::map<id, patient> would suit your needs via:
operator[] to add a record
at/find for retrieval
erase for removal
If you need more complex queries I'd recommend a full-fledged relational database.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Relatively new to C++ but I am very interested in the algorithmic aspect of programming.
Is there a general framework for deciding if an algorithm is efficient? i.e. the quickest possible?
I am trying to write pseudocode on paper before implementing but there are probably many different ways to solve any given problem.
Would be very keen to learn best practice for constructing / analysing algorithms.
Thanks, and Happy New Year!
Yes you can start with the Wikipedia article explaining the Big O notation, which in a nutshell is a way of describing the "efficiency" (upper bound of complexity) of different type of algorithms. Or you can look at an earlier answer where this is explained in simple english