10

I just posted two questions on Stack Overflow in which I also included answers:

How is it possible to do binary search on a doubly-linked list in O(n) time?

How is it possible to do binary search on a singly-linked list in O(n) time?

I was reminded of the algorithm that you would use for the first of these cases when a friend talk about this coming up during a job interview, and on my commute to work realized that the second of these was possible at all. I really like algorithms and data structures and thought it was nifty that it was possible to combine a fundamental algorithm and fundamental data structure in a way I hadn't seen before.

After posting these, both questions and their answers got downvoted and there was some discussion in the comments about whether it was appropriate to post these questions.

I have a few questions:

  • Was it in appropriate for me to post these questions with answers? This isn't the first time I've posted a question/answer pair (I actually like sharing things with SO this way), and I think that it's encouraged, but I wanted to double-check that this is the case.

  • Was this the right way for me to post these question/answer pairs? I posted these as separate questions because the algorithms in both cases are different, though they're closely-related. I figured that it would be useful to describe them separately to highlight the differences between the array/doubly-linked list case and the doubly-linked list/singly-linked list cases, though in retrospect that might not have been a good idea. Would it have been more appropriate to post a combined question that covered both cases?

  • Is there any recourse for the downvotes? I have a lot of reputation and don't care too much about the reputation points, but it's weird to get four downvotes in under a minute for question/answer pairs that I was really happy about.

Thanks everyone!

  • 3
    Ugh. This happens way too often, regardless of how well the question and answer were written. A lot of users seem to be unaware that 1) we actually want people to answer their own questions if they can, and 2) there's a feature allowing you to post a question and answer it simultaneously. I feel like I have to link to the same blog post in the comments every time I post a self-answered question just to make people aware that something like this is actually acceptable and encouraged and hopefully reduce ignorant downvotes. – BoltClock's a Unicorn Oct 24 '13 at 5:45
10
  • Was it inappropriate for me to post these questions with answers? From what I can see, this was done well and effectively. This is a good example for many of the things we like to see in self-answered questions. In particular, you've clearly defined what the question is - something most self-answerers mess up frequently.

  • Was this the right way for me to post these question/answer pairs? Pretty much, yeah. This is is the correct way to post answers. While they are related, they are not the same question. Therefore, they do not belong in the same question; splitting them up is correct. Think of Q&A no differently when you ask and answer as someone else.

  • Is there any recourse for the downvotes? Unfortunately, no; people have the right to vote as they please, even if their reasons are not justified. However, I'm sure you'll end up with net positive reputation from the experience.

In short, answering your own questions is very much appreciated, when done properly. You have done so; by clearly defining the question, you've made it such that the question can stand on its own. The answers are clear and support the question.

Kudos to you.

  • The OP made a typo and linked twice to the same question in the OP. I fixed it. The way the OP asks questions and answers them himself is fantastic. He does a great job. The answers are not the same. – dcaswell Oct 24 '13 at 1:53
  • @dcaswell Revised for that. – Aza Oct 24 '13 at 3:06
  • @Yoda I rolled back, as I thought my original copy applied. Sorry. – Aza Oct 24 '13 at 7:59
  • Whooooo. 8888 reputation. I spent too much time here. – Aza Oct 24 '13 at 8:01
7

I don't think there's anything wrong with what you're doing. I follow the tag and when I read your questions I think "that's a very interesting question", I hope templatetypedef answers it. Then I'm completely surprised to see you as the Question Asker.

When I read the answer I appreciate the knowledge you're sharing.

I think you're successfully helping the Stack Overflow commmunity.

3

I believe you, yourself, put a link to the Self-Answers page in your comment. So, you already know it's completely appropriate to post a question and answer it yourself. I asked something similar and was more or less told the same thing.

As for recourse for the downvotes, I guess it's a risk you take when you self-answer. Some people might not like it, and there's nothing you can do about it.

You must log in to answer this question.

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