Relative Content

Tag Archive for data-structures

Heap overflow vs stack overflow

So as a general rule to avoid a stack overflow, big objects should be allocated to the heap (correct me if I am wrong). But, since the heap and the stack expand towards each other, wouldn’t this cause heap overflow or alternatively limit the space for the stack and higher the chances of stack overflow?

How to model/structure data that contains parent/child relationships for the same entity?

I think it is just my thinking that is off here. Suppose I have two entities: question and choice. A question can be a parent or child, or both (in relation to other questions). It seems that this model is too simple and is an unresolved many-to-many, but I think my thinking is the problem here so this is more of a conceptual question. What is the best way to design/model this? Please explain why it is or isn’t a many-to-many relationship, and whether or not it needs to be resolved and why. See below:

Building a Graph Editor – How to create a data driven graph

I am developing a graph-editor that uses drag and drop to build hierarchical graphs (containing nodes and links). Each node in the graph should be linked to a table in our database (SQL Server). I did a lot of research about libraries based on javascript or/and JSON specifications to draw nodes and links. There are a lot of great examples to follow, but I have no idea about the way I can link a graph to a database (SQL Server, Oracle, MySQL…). I thought about this architecture (Question posted on stackexchange.com)

What’s the difference between a stream and a queue?

What’s the difference between a stream and a queue? They both have the concept of an ordered set of elements, but tend to have different implementations and a different vocabulary of ‘insert’/’extract’ (streams) vs. ‘enqueue’/’dequeue’ (queue). Are these interchangable? Do they suggest different concepts or patterns? If so, what are the differences?