Questions tagged [hierarchy]

For issues relating to creating, maintaining, or displaying a hierarchy of data or resources, etc.

A hierarchy is an arrangement of items (objects, names, values, categories, resources, etc.) in which the items are represented as being "above," "below," or "at the same level as" one another. Abstractly, a hierarchy is simply an ordered set or an acyclic directed graph.

A hierarchy can link entities either directly or indirectly, and either vertically or horizontally. The only direct links in a hierarchy, insofar as they are hierarchical, are to one's immediate superior or to one of one's subordinates, although a system that is largely hierarchical can also incorporate alternative hierarchies. Indirect hierarchical links can extend "vertically" upwards or downwards via multiple links in the same direction, following a path. All parts of the hierarchy which are not linked vertically to one another nevertheless can be "horizontally" linked through a path by traveling up the hierarchy to find a common direct or indirect superior, and then down again.

2838 questions
8
votes
10 answers

ViewControllers are not destructing

I've got a serious problem with my iOS app. I have a login logic in my application. When logging in and then logging out, some view controllers are not destructing. This causes some issues, for example, some events that I emit using…
gal
  • 929
  • 4
  • 21
  • 39
8
votes
1 answer

SQL Query: Hierarchical Coalesce

I have a table that defines a hierarchy: Create Table [example] ( id Integer Not Null Primary Key, parentID Integer Null, largeData1 nVarChar(max) Null, largeData2 nVarChar(max) Null); -- largeData3...n also…
Chris Nielsen
  • 14,731
  • 7
  • 48
  • 54
8
votes
3 answers

r - hierarchical data frame from child/parent relations

I have a child - parent data.frame that I want to transform to a complete hierarchical list with all levels and a level number. The example data below goes to three levels, but it could be more. What function can I use to transform the…
Timm S.
  • 5,135
  • 6
  • 24
  • 38
8
votes
4 answers

How can you order a hierarchy of objects by depth-level using LINQ?

Consider this hierarchy A | -------------------------- | | B C | | --------|-------- …
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
8
votes
1 answer

How to group tests using specs2?

I'm used to JUnit, in JUnit it is possible to group several tests (usually related to a class) just by defining these tests in a single file (class) and annotating them with @Test. Then, to run several of these tests, a TestSuite is created with…
Trylks
  • 1,458
  • 2
  • 18
  • 31
8
votes
2 answers

Question about SQL Server HierarchyID depth-first performance

I am trying to implement hierarchyID in a table (dbo.[Message]) containing roughly 50,000 rows (will grow substantially in the future). However it takes 30-40 seconds to retrieve about 25 results. The root node is a filler in order to provide…
ObjectiveCat
  • 312
  • 1
  • 4
  • 12
8
votes
1 answer

Memory Hierarchy - Why are registers expensive?

I understand that: Faster access time > More expensive Slower access time > Less expensive I also understand that registers are the top of the hierarchy, and have the fastest access time. What I am having a hard time researching is why it's so…
ajdbnabad13
  • 355
  • 3
  • 11
8
votes
2 answers

Increasing gap between nodes of my D3 tree layout

As shown in the diagram, I am trying to increase the gap between last nodes on either side of the tree layout as they are overlapping Is there any way to do it in D3? { "name": "", "type": "network", …
javalearner
  • 347
  • 2
  • 7
  • 21
8
votes
2 answers

High-Performance Hierarchical Text Search

I'm now in the final stages of upgrading the hierarchy design in a major transactional system, and I have been staring for a while at this 150-line query (which I'll spare you all the tedium of reading) and thinking that there has got to be a better…
Aaronaught
  • 120,909
  • 25
  • 266
  • 342
8
votes
9 answers

Select products where the category belongs to any category in the hierarchy

I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example: Computers Processors Intel Pentium Core 2 Duo …
Bruno
  • 4,337
  • 12
  • 42
  • 55
8
votes
1 answer

Sum of child levels total in a Hierarchy

I need to have each level be the sum of all children (in the hierarchy) in addition to any values set against that value itself for the Budget and Revised Budget columns. I've included a simplified version of my table structure and some sample data…
8
votes
10 answers

Walking a tree, parent first

What is the best way to visit all the nodes of a linked tree (all nodes have references to parent and all children, root nodes have null as parent), so that no node is visited before any of its ancestors? Brownie points for non-recursive.
George
  • 3,433
  • 4
  • 27
  • 25
8
votes
3 answers

Create nested list from PHP array for dropdown select field

I am struggling with an array I want to turn into a nested < select > I need: