Skip to content

Commit 80c121d

Browse files
authored
Updated
1 parent 2d399ee commit 80c121d

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,56 +24,47 @@ My personal experience stems from PhD courses at UCF and Udacity nanodegree:
2424
- [COT 5405: Design & Analysis Algorithms](http://www.cs.ucf.edu/~sharma/COT5405)
2525
- [COT 6410: Computational Complexity](http://www.cs.ucf.edu/courses/cot6410/Spring2021/COT6410Spring2021.html)
2626

27-
Solving any algorithm problem:
27+
How to solving algorithm problems:
2828
==============================
2929

3030
![](media/807b5c8aee182baaa1713c01e98994f9.png)
3131

3232
Think in simple term:
3333

34-
1. Don’t panic
34+
1. What are the inputs
3535

36-
2. What are the inputs
36+
2. What are the outputs
3737

38-
3. What are the outputsa
39-
40-
4. Solve the problem
38+
3. Step-by-step ways that can connect the two
4139

4240
**Next:**
4341

44-
Do some examples on paper/mind, find **relationship** between input and output,
45-
finally, test some cases.
46-
47-
Try solve the problem **On paper first**.
42+
Do some examples on paper or on your mind. The trick is to find the correct **relationships** between input and output.
43+
Finally, you can test some cases and fine-tune your approach for special cases.
4844

49-
Write algorithm. Pseudocode.
45+
Writing the algorithm can be done by writing the _pseudocode_.
5046

51-
Example 1 [Code included]: Write an algorithm /code that counts the difference
47+
Question 1: Write an algorithm/program that returns the difference
5248
of two dates.
5349

54-
Ask yourself:
55-
56-
Dates, DF, are all the inputs are valid? 1st data 2nd Second date must not be
57-
older than 1: invalid input
50+
**Step 1: Ask yourself the following questions**
5851

59-
How input are encoded? (yyyy,mm,dd)
60-
61-
Output return a number because we can do things with return value rather
62-
printing it
52+
Q: For inputs (dates), what are the valid inputs?
53+
Q: How input are encoded? (yyyy,mm,dd)
54+
Q: Possible output returns? (an integer)
6355

6456
![](media/aafcce2fa1d4355bed1f9c7f5850c437.png)
6557

66-
First code: writing a block that makes the solution to work. Solve with a single
67-
simple case.
58+
**Step 2: Write simple code that works partially for the problem**
59+
- Chances are, you need to consider all possible conditions. Often, this results in getting stuck in finding the perfect solutions. Hence, its advisable that you find the simplest solution that works. E,g, solve with a single simple case.
6860

61+
Tips:
6962
Break into simple parts so that we can see our progress.
70-
7163
Write simple small codes that work
72-
73-
No need to figure out all the details. Consider that you will procrastinate
74-
later
64+
No need to figure out all the details.
7565

7666

67+
# Concepts:
7768

7869
Big O Notion:
7970
=============

0 commit comments

Comments
 (0)