2

I asked a question here: Traversing over dictionary using variable number of keys

It was closed within two minutes by a user with the gold badge for closing duplicates.

The question demonstrates prior research which I have done on this and shows my attempts at solving the problem. I believe the linked duplicate does not answer my question. Even if it does, it only has a far resemblance to what I'm trying to solve.

So if people close questions that even remotely look similar to some other random question, how can people ask specific questions ever?

Do you feel the question was an exact duplicate? If you agree with the question being closed, could you explain why you think it shoud remain closed? I think it will help me ask better questions in the future.

I feel I'm misunderstanding how the site works -- I want to know if this is the general policy or just a user who likes to close questions.

1
  • 8
    Edit your question to explain exactly why the duplicate's answers do not explain your question. What happens when you try those answers? How does that differ from what you want to happen? You also say you've searched other questions but you don't explain why they are unhelpful. Jan 4, 2018 at 12:32

2 Answers 2

17

As the user who originally closed your question, let me explain myself, first, by addressing the points in your post here.

The question demonstrates prior research which I have done on this and shows my attempts at solving the problem.

Indeed, credit must be given where it is due. You don't realise how refreshing it is for someone who has to deal with the daily onslaught of low effort VLQs, to see a well written, good, on topic question here. This is also why I've upvoted your question.

I believe the linked duplicate does not answer my question. Even if it does, it only has a far resemblance to what I'm trying to solve.

On its surface, the answer in the duplicate appears to be solving a different question, but as Andras Deak so expertly worded it -

It seems to me that the accepted answer on the linked duplicate is really what you need. The only differences are that your _end is None, and that instead of looping over each character in a word you have to loop over every item in url_path_parts, or something similar.

So, in essence, your question has all the makings of a problem that can be best solved using a TRIE, which is why I have marked the question as such. In my opinion, it is better to be directed towards the best solution immediately, rather than face the possibility of receiving sub-par answers to your question which may or may not solve your problem as well as the target would. However, mark that there are exceptions where a particular tool has developed since the original question was asked. In this case, you may argue that your question could receive a possibly better answer than the original. Note that SO's policy on this is that the better answer should be added to the original question, to prevent fragmentation of the knowledge base.

One thing I should've done, was made it clearer how exactly the target solved your problem, and I did not make that clear to you. My apologies. I hope it's clear now.

If you agree with the question being closed, could you explain why you think it shoud remain closed? I think it will help me ask better questions in the future.

Never for a moment believe that there is any shame in asking a question that has already been asked before. A duplicate question acts as a signpost, directing users with the same problem (but searching with different keywords on google) to find the question that helps them the most. We welcome duplicates, as long as the questions show that the user has genuinely made an attempt to research and solve their problem first.

In summary, I believe your question was a well thought out, well researched and well written question, for which a TRIE would be the best answer, and marked as such.

No hard feelings, and I hope you will continue returning to this site to contribute with more valuable questions and answers in future.

18

Your question was well-formed, no wonder it wasn't closed as off-topic nor downvoted. But as I also noted in a comment, I believe the dupe closure was merited.

You want to build a tree from nested dictionaries based on URLs. You have pseudocode describing your approach, and the question

Or is there a better way to do this? I have been trying for the past two days and could not get it done.

The accepted answer to the linked duplicate shows how to build a tree from nested dictionaries. It seems to me that this is exactly what you need, the only difference being that you want your _end sentinel to be None, and instead of building the levels of your trees from each character in a word you want to build them from the items in the URL split on '/'. The algorithm and the data structure are the exact same. Trivial changes should be accounted for when closing as duplicates, so unless you try implementing a solution based on the accepted answer and show why it isn't sufficient, I believe your question should stay closed as a dupe.

Not the answer you're looking for? Browse other questions tagged .