Which data structure is most suitable? - data-structures

Which data structure is most suitable for forward and backward webpage traversal in web browsers?
Answer is Doubly Linked List. Why? Why can't we use Tree with pointer for it?

Because there is only two operations you can do in a web browser, forward and backward.
What would be the use of an entire tree? You can't choose a branch.

Related

best data structure to represent a non-binary tree

I have a hierarchical data structure. There is not much addition, deletion done to this structure, its mostly for reading and searching. I'm trying my best to find a good data structure to store this data to enable fast searching. All the examples/tutorials I have seen talk about some form of binary tree. Is there a data structure (tree) that will enable me to model this effectively. An alternative form I can think of is to use a graph, but I'm not sure about that.
B-Tree will be the best choice for your description because of its amazing performance in "reading and searching", it will enable you achieve log(n) for insertion/deletion/search, beside it's a cache friendly so you will get the minimum number of cache misses.

Why does using a queue data structure in implementing Depth First Search makes it a Breadth First Search?

I know Depth-first search is implemented using a LIFO data structure and using a FIFO structure like a queue gives you Breadth First Search instead, but why?
I would suggest you first understand what a stack (FIFO) and queue (LIFO) data structure is. I'm sure you'll be able to reason the rest from there.
https://www.youtube.com/watch?v=bIA8HEEUxZI
A short video to get you started.

How was the concept of tree (abstract data type) first proposed?

I'm learning the tree (abstract data type), and I don't just want to know about the definition and operations, which can be found without any difficulty.
I want more, especially who propose the tree, and in what situation did he work out the tree structure. Because besides using the tree, I'm interested in why some people can design such a usefull data structure.
By the way, when I learn Stack(another data structure), I find a short history that tell me how the stack were proposed in Wikipedia. But when it comes to Tree, there is no such a history.
So, could anybody tell me something about the history of Tree? Thanks!

Best tree structure for Multi-dimensional data

To organize multi-dimensional data,
What is the most useful and efficient tree data structure?
(eg, K-D-B tree, region quadtree, R-tree)
I want to know best search time and best space utilization tree structure.
It highly depends on how your data is distributed in the space and how you want to search for it (what are the criteria you query for?).
It is very easy to find the right quad-tree bin given a location in space, on the other hand it introduces more overhead than a well-shaped kd-tree. There is a reason why all of these techniques are still in use.
Specify the problem you want to solve with the data structure.
Different data structures, including trees and information about them and source code of their implementation is found at https://ece.uwaterloo.ca/~ece250/Algorithms/
Furthermore, runtime information and asymptotic analysis on different types of tree structures is found under section 4 at https://ece.uwaterloo.ca/~ece250/Lectures/Slides/
These are very useful and reliable and this way you can choose the best structure depending on your specific needs/ data
I hope this helps!

LINQ/Lambda to Binary Tree

I'm looking for a way to select from a binary tree (AVL or B tree) using Lambda without running through all the nodes in the tree.
Any suggestions or interesting links?
If you want your binary tree to take advantage of the structure it knows it has to provide improved performance when queried with LINQ, you need to implement an IQueryProvider.
There's an excellent series of blog posts on that here, but this is not something to be undertaken lightly.

Resources