Just-A-Visitor / Algorithmic-Pseudocode

This repository contains the pseudocode(pdf) of various algorithms and data structures necessary for Interview Preparation and Competitive Coding
GNU General Public License v3.0
762 stars 167 forks source link

Pseudocode for First Non Repeating Character in a Stream #29

Closed ghost closed 5 years ago

stellarbeam commented 5 years ago

Could you describe the issue in detail? I'd like to work on this :)

ghost commented 5 years ago

Suppose you are given a string, say, comppmco. Now, you need to find the first non-repeating character when each character arrives.

1) When c arrives, the answer is c 2) When o arrives, the answer is still c 3) When m arrives, the answer is c 4) When p arrives, the answer is c 5) When the next p arrives the answer is c 6) When the next m arrives, the answer is c 7) When the next c arrives, the answer is o 8) When the next o arrives, the answer is null (as every character is repeating).

Solution Hint : Use queue

That was the problem statement. Now, you need to write the pseudocode for this problem. You can pick the initial template here. Please go through the ReadMe once.

Please clear your doubts before beginning the coding phase.

When you make a pull request, do not include the final pdf file. We'll review it first and then you can add it. (This is to remove unwanted binary files from the history).

Before you begin writing the pseudocode, please submit your solution here to validate your approach. After that, you can transform your approach to pseudocode, but try not to be too language-specific.

Let me know if you need more details.

stellarbeam commented 5 years ago

Awesome, I'll start working on this.

stellarbeam commented 5 years ago

Under what directory should I put the SourceCode.tex file?

ghost commented 5 years ago

Pseudocode/Queue/First Non Repeating in Stream/SourceCode.tex

Just a reminder, do not place the pdf file. Also, sync your fork before the pull request! You can create the Queue directory (as it hasn't been created yet).