What are the most common problems that can be solved with both these data structures?

It would be good for me to have also recommendations on books that:

- Implement the structures
- Implement and explain the reasoning of the algorithms that use them

original title: "algorithm - What problems can be solved, or tackled more easily, using graphs and trees?"

Translate

What are the most common problems that can be solved with both these data structures?

It would be good for me to have also recommendations on books that:

- Implement the structures
- Implement and explain the reasoning of the algorithms that use them

सबसे आम समस्याएं क्या हैं जो इन दोनों डेटा संरचनाओं के साथ हल की जा सकती हैं? मेरे लिए यह अच्छा होगा कि मैं भी उन किताबों की सिफारिशें करूँ जो: संरचनाओं को लागू करें और लागू करें ...

यह अनुवाद के बाद का सारांश है, अगर आपको पूरा अनुवाद देखने की आवश्यकता है, तो कृपया 'अनुवाद' आइकन पर क्लिक करें

सभी उत्तर

- अजगर में नेटवर्कएक्स का उपयोग करके निर्देशित ग्राफ़ कैसे बनाएं?
- algorithm - खंड पेड़, अंतराल पेड़, द्विआधारी अनुक्रमित पेड़ और श्रेणी के पेड़ के बीच अंतर क्या हैं?
- c# - DbEntityValidationException - मैं आसानी से कैसे बता सकता हूं कि त्रुटि का कारण क्या है?
- database - बी पेड़ों और बी + पेड़ों के बीच अंतर
- बाइनरी पेड़ों के आवेदन क्या हैं?

- winapi - Win32 API का उपयोग करके C # में फ्रंट में विंडो लाना
- security - मेरी वेबसाइट हैक हो गई .. मुझे क्या करना चाहिए?
- जावा में तार को पार्स करने के विभिन्न तरीके क्या हैं?
- OCR पर पूर्ण-पाठ का उत्पादन करने के लिए अनुक्रमण सेवा और MODI कैसे प्राप्त करें?
- क्या स्टैक ओवरफ्लो में इंक्लूजनिस्ट या डिलेटेनिस्ट होना चाहिए? - मेटा स्टैक एक्सचेंज

The first thing I think about when I read this question is:

what types of things use graphs/trees?and then I think backwards to how I could use them.For example, take two common uses of a tree:

The DOM, and XML for that matter, resemble tree structures.

It makes sense, too.

It makes sense because of how this data needs to be arranged. A file system, too. On a UNIX system there's a root node, and branching down below. When you mount a new device, you're attaching it onto the tree.You should also be asking yourself: does the data fall into this type of structure? Create data structures that make sense to the problem and the rest will follow.

As far as being easier, I think thats relative. Are you good with recursive functions to traverse a tree/graph? What if you need to balance the tree?

Think about a program that solves a word search puzzle. You could map out all the letters of the word search into a graph and check surrounding nodes to see if that string is matching any of the words. But couldn't you just do the same with with a single array? All you really need to do is move an index to check letters to the left and right, and by the width to check above and below letters. Solving this problem with a graph isn't difficult, but it can create a lot of extra work and difficulty if you're not comfortable with using them - of course that shouldn't discourage you from doing it, especially if you are learning about them.

I hope that helps you think about these structures. As for a book recommendation, I'd have to go with

Introduction to Algorithms.Circuit diagrams.

Compilation (Directed Acyclic graphs)

Maps. Very compact as graphs.

Network flow problems.

Decision

treesfor expert systems (sic)Fishbone diagrams for fault finding, process improvment, safety analysis. For bonus points, implement your error recovery code as objects that

arethe fishbone diagram.Just about every problem can be re-written in terms of graph theory. I'm not kidding, look at any book on NP complete problems, there are some pretty wacky problems that get turned into graph theory because we have good tools for working with graphs...

The Algorithm Design Manual contains some interesting case studies with creative use of graphs. Despite its name, the book is very readable and even entertaining at times.

There's a course for such things at my university: CSE 326. I didn't think the book was too useful, but the projects are fun and teach you a fair bit about implementing some of the simpler structures.

As for examples, one of the most common problems (by number of people using it) that's solved with trees is that of cell phone text entry. You can use trees, not necessarily binary, to represent the space of possible words that can come out of any given list of numbers that a user punches in very quickly.

Algorithms for Java: Part 5 by Robert Sedgewick is all about graph algorithms and datastructures. This would be a good first book to work through if you want to implement some graph algorithms.

Scene graphs for drawing graphics in games and multimedia applications heavily use trees and graphs. Nodes represents objects to be rendered, transformations, controls, groups, ...

Scene graphs usually have multiple layers and attributes which mean that you can draw only some node of a graph (attributes) in a specified order (layers). Depending on the kind of scene graph you have it can have two parralel structures: declarations and instantiation. Th

@DavidJoiner / all:

FWIW: A new version of the Algorithm Design Manual is due out any day now.

The entire course that he Prof Skiena developed this book for is also available on the web:

http://www.cs.sunysb.edu/~algorith/video-lectures/2007-1.html

Trees are used a lot more in functional programming languages because of their recursive nature.

Also, graphs and trees are a good way to model a lot of AI problems.

Games often use graphs to facilitate finding paths across the game world. The graph representation of the world can have algorithms such as breadth-first search or A* in order to find a route across it.

They also often use trees to represent entities within the world. If you have thousands of entities and need to find one at a certain position then iterating linearly through a list can be inefficient, especially if you need to do it often. Therefore the area can be subdivided into a tree to allow it to be searched more quickly. Just as a linear space can be efficiently searched with a binary search (and thus divided into a binary tree), 2D space can be divided into a quadtree and 3D space into an octree.