분류 전체보기
-
[Introduction to Algorithms, CLRS] Exercise 1.1-1알고리즘 2017. 8. 14. 12:14
This is a solution for Introduction to Algorithms. I write this for my study purpose. 1.1-1 Give a real-world example that requires sorting or a real-world example that re- quires computing a convex hull. Answer: 1) Sorting: - Contact list in my smart phone, alphabetically sorted. - Email list in Gmail app, sorted in time. 2) Convex Hull: (I think this is the most interesting answer that I found..
-
In PyCharm, how to load code from the editor to console카테고리 없음 2017. 7. 22. 20:05
While I was running the code form the Problem Solving with Algorithms and Data Structures, I've encountered some pages to encourage write class codes in code editor window but running it from Python console, for example in chapter 7.6. I did not know how I can load the class code from editor in console window. After searching from the web, I found this page. Loading Code from Editor into Console..
-
In Python, how to swap two numbers without using a temp variable카테고리 없음 2017. 6. 25. 09:02
This is a very interesting question: How to swap two number variables without using a temp variable? I have actually been asked this question while being interviewed for a job. Also this is a very well-known coding interview questions; therefore some books of interview preparation cover this question, for example, Cracking the Coding Interview. The answer is here. x = x + y; // x now becomes 15 ..
-
Review on PSAD 5.5카테고리 없음 2017. 6. 10. 18:08
While I was studying "Problem Solving with Algorithms and Data Structures using Python", I encountered two things that look very interesting. First of all, I became very interested in why Python allows a comma at the end of the list. I could find a interesting discussion on a stackoverflow page. To sum up, it is allowed to make it easier to edit multi-line lists.Second thing that I caught my att..
-
Review on PSAD 3.5카테고리 없음 2017. 5. 5. 12:19
While I was studying Problem Solving Algorithms and Data Structures using Python, I found that some of you might need more explanation on how to run the code in listings. How to use pythonds? pythonds is a package that has the basic data structures written in Python. You can down load it where the book is pointing: http://www.pythonworks.org/pythonds After downloading it, you need to install it ..
-
Review on PSAD 2.4카테고리 없음 2017. 5. 4. 17:23
While I was studying Problem Solving with Algorithms and Data Structure using Python, I have found some interesting features on Python. 1. Python has a ord() It is very interesting that there's a function returning a integer representing the Unicode code point of the character. Please have a look at this page for buit-in functions: https://docs.python.org/2/library/functions.html 2. Declaring an..
-
PSAD review on 1.13카테고리 없음 2017. 5. 2. 13:01
While I was studying PSAD, I found some interesting python features and would like to give some feedback. 1. Python has //, even tough it doesn't have ++ Interestingly, Python has '//' operator. What it does is returning the division value flooring the fraction. Please check http://stackoverflow.com/questions/183853/in-python-2-what-is-the-difference-between-and-when-used-for-division On the oth..
-
Interesting Python features (?)카테고리 없음 2017. 5. 2. 11:26
While I was studying "Problem Solving with Algorithms and Data Structures using Python", I found some interesting features (or syntax) while studying chapter 1. 1. It has "elif" You might have found you want several "else if" statements. Python helps you by shortening it to "elif". Please check https://docs.python.org/3/tutorial/controlflow.html 2. Your fraction may be different from other Pytho..