Showing posts with label scan document. Show all posts
Showing posts with label scan document. Show all posts

Monday, April 3, 2017

Code review: C# LINQ and string.Split do it yourself

April 3, 2017

Introduction

As an old saying in Ecclesisaster 3 - A time for everything, Julia likes to take 5 minutes to celebrate her 8k reached milestone. Show the visual stuff here:


Code Review


Julia spent 45 minutes to write an algorithm to scan the sentence without compiler, and then spent over one hour to make it run using Microsoft visual studio. And then, she asked a question on code review.

Here is the link of code review. She was so surprised to get excellent code review. Sky is the limit, she has to learn so many things through the code review.

She was busy to read those documents of interface and class in order to understand the code review and discussion, IEnumerable, StringComparer, StringSplitOptions, Regex.


Sunday, April 2, 2017

Code practice: analysis of scan document

April 2, 2017

Introduction


Julia likes to practice using LINQ and also learn how to write a C# program. Scan a string and then parse string using delimiters and order by descending order of word's count.

Time complexity analysis: O(Nm), N is the string length, m is the delimiters' length.

Code study 


C# code is here.

Julia reinvented the wheel, write a string.Split(char[]) method. She enjoyed the practice.

Julia need to train herself on LINQ - write statement to query Dictionary and then sort by value using descending order.

Stackoverflow question on LINQ - query dictionary and then sort by value using descending order.

Edge case in SplitMethod()

Actionable Item


Do not stop coding review. Always Julia gets surprising result. Code review this one to celebrate the weekend of first April, 2017.