From 16aeca9bc63b035e351ccf7c85bb0cfb96d2049e Mon Sep 17 00:00:00 2001 From: Piyush Sharma Date: Fri, 10 Mar 2017 22:24:29 -0800 Subject: [PATCH 1/2] Update the directory's under Python for better terminal access. --- .../Question1_1/1-unique.py | 0 .../Question1_1/ChapQ1.1.py | 0 .../{Chapter 1 => Chapter_1}/Question1_1/alluniq.py | 0 .../Question1_1/testalluniq.py | 0 .../Question1_2/ChapQ1.2.py | 0 .../{Chapter 1 => Chapter_1}/Question1_2/revstr.py | 0 .../Question1_2/testrevstr.py | 0 .../Question1_3/ChapQ1.3.py | 0 .../{Chapter 1 => Chapter_1}/Question1_3/anagram.py | 0 .../Question1_3/testanagram.py | 0 .../Question1_4/ChapQ1.4.py | 0 python/{Chapter 1 => Chapter_1}/Question1_4/Q1_4.py | 0 .../{Chapter 1 => Chapter_1}/Question1_4/replace.py | 0 .../Question1_4/testreplace.py | 0 .../Question1_5/ChapQ1.5.py | 0 .../Question1_5/compress.py | 0 .../Question1_5/testcompress.py | 0 .../Question1_6/ChapQ1.6.py | 0 .../Question1_6/rotateimg.py | 0 .../Question1_6/testrotate.py | 0 .../Question1_7/ChapQ1.7.py | 0 .../Question1_8/ChapQ1.8.py | 0 python/{Chapter 2 => Chapter_2}/Question2_1.py | 0 python/{Chapter 2 => Chapter_2}/Question2_2.py | 0 python/{Chapter 2 => Chapter_2}/Question2_3.py | 0 python/{Chapter 2 => Chapter_2}/Question2_4.py | 0 python/{Chapter 2 => Chapter_2}/Question2_5.py | 0 python/{Chapter 2 => Chapter_2}/Question2_6.py | 0 python/{Chapter 2 => Chapter_2}/Question2_7.py | 0 .../{Chapter 2 => Chapter_2}/classes/LinkedList.py | 0 .../{Chapter 2 => Chapter_2}/classes/LinkedList.pyc | Bin python/{Chapter 2 => Chapter_2}/classes/__init__.py | 0 .../{Chapter 2 => Chapter_2}/classes/__init__.pyc | Bin python/{Chapter 3 => Chapter_3}/Question3_1/Q3_1.py | 0 .../Question3_2/ChapQ3.2.py | 0 python/{Chapter 3 => Chapter_3}/Question3_3/Q3_3.py | 0 python/{Chapter 3 => Chapter_3}/Question3_4/Q3_4.py | 0 python/{Chapter 3 => Chapter_3}/Question3_5/3_5.py | 0 .../Question3_5/ChapQ3.5.py | 0 .../Question3_6/ChapQ3.6.py | 0 .../Question3_7/ChapQ3.7.py | 0 .../Question4_1/ChapQ4.1.py | 0 .../Question4_2/ChapQ4.2.py | 0 .../Question4_3/ChapQ4.3.py | 0 .../Question4_4/ChapQ4.4.py | 0 .../Question4_5/ChapQ4.5.py | 0 .../Question4_6/ChapQ4.6.py | 0 .../Question4_7/BinaryTreeNode.py | 0 python/{Chapter 4 => Chapter_4}/Question4_7/Q4_7.py | 0 .../Question4_8/ChapQ4.8.py | 0 .../Question4_9/BinaryTreeNode.py | 0 python/{Chapter 4 => Chapter_4}/Question4_9/Q4_9.py | 0 .../Question9_01/staircase.py | 0 .../Question9_02/robot_paths.py | 0 .../Question9_03/magic_index.py | 0 .../Question9_03/magic_index_followup.py | 0 .../Question9_04/subsets.py | 0 .../Question9_05/permutations.py | 0 .../Question9_06/parentheses.py | 0 .../Question9_07/paint_fill.py | 0 .../Question9_08/change_making.py | 0 .../Question9_09/queens_problem.py | 0 .../Question9_10/tallest_stack.py | 0 .../Question9_11/parenthesizing.py | 0 64 files changed, 0 insertions(+), 0 deletions(-) rename python/{Chapter 1 => Chapter_1}/Question1_1/1-unique.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_1/ChapQ1.1.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_1/alluniq.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_1/testalluniq.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_2/ChapQ1.2.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_2/revstr.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_2/testrevstr.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_3/ChapQ1.3.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_3/anagram.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_3/testanagram.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_4/ChapQ1.4.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_4/Q1_4.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_4/replace.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_4/testreplace.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_5/ChapQ1.5.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_5/compress.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_5/testcompress.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_6/ChapQ1.6.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_6/rotateimg.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_6/testrotate.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_7/ChapQ1.7.py (100%) rename python/{Chapter 1 => Chapter_1}/Question1_8/ChapQ1.8.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_1.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_2.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_3.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_4.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_5.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_6.py (100%) rename python/{Chapter 2 => Chapter_2}/Question2_7.py (100%) rename python/{Chapter 2 => Chapter_2}/classes/LinkedList.py (100%) rename python/{Chapter 2 => Chapter_2}/classes/LinkedList.pyc (100%) rename python/{Chapter 2 => Chapter_2}/classes/__init__.py (100%) rename python/{Chapter 2 => Chapter_2}/classes/__init__.pyc (100%) rename python/{Chapter 3 => Chapter_3}/Question3_1/Q3_1.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_2/ChapQ3.2.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_3/Q3_3.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_4/Q3_4.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_5/3_5.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_5/ChapQ3.5.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_6/ChapQ3.6.py (100%) rename python/{Chapter 3 => Chapter_3}/Question3_7/ChapQ3.7.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_1/ChapQ4.1.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_2/ChapQ4.2.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_3/ChapQ4.3.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_4/ChapQ4.4.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_5/ChapQ4.5.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_6/ChapQ4.6.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_7/BinaryTreeNode.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_7/Q4_7.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_8/ChapQ4.8.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_9/BinaryTreeNode.py (100%) rename python/{Chapter 4 => Chapter_4}/Question4_9/Q4_9.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_01/staircase.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_02/robot_paths.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_03/magic_index.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_03/magic_index_followup.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_04/subsets.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_05/permutations.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_06/parentheses.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_07/paint_fill.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_08/change_making.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_09/queens_problem.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_10/tallest_stack.py (100%) rename python/{Chapter 9 => Chapter_9}/Question9_11/parenthesizing.py (100%) diff --git a/python/Chapter 1/Question1_1/1-unique.py b/python/Chapter_1/Question1_1/1-unique.py similarity index 100% rename from python/Chapter 1/Question1_1/1-unique.py rename to python/Chapter_1/Question1_1/1-unique.py diff --git a/python/Chapter 1/Question1_1/ChapQ1.1.py b/python/Chapter_1/Question1_1/ChapQ1.1.py similarity index 100% rename from python/Chapter 1/Question1_1/ChapQ1.1.py rename to python/Chapter_1/Question1_1/ChapQ1.1.py diff --git a/python/Chapter 1/Question1_1/alluniq.py b/python/Chapter_1/Question1_1/alluniq.py similarity index 100% rename from python/Chapter 1/Question1_1/alluniq.py rename to python/Chapter_1/Question1_1/alluniq.py diff --git a/python/Chapter 1/Question1_1/testalluniq.py b/python/Chapter_1/Question1_1/testalluniq.py similarity index 100% rename from python/Chapter 1/Question1_1/testalluniq.py rename to python/Chapter_1/Question1_1/testalluniq.py diff --git a/python/Chapter 1/Question1_2/ChapQ1.2.py b/python/Chapter_1/Question1_2/ChapQ1.2.py similarity index 100% rename from python/Chapter 1/Question1_2/ChapQ1.2.py rename to python/Chapter_1/Question1_2/ChapQ1.2.py diff --git a/python/Chapter 1/Question1_2/revstr.py b/python/Chapter_1/Question1_2/revstr.py similarity index 100% rename from python/Chapter 1/Question1_2/revstr.py rename to python/Chapter_1/Question1_2/revstr.py diff --git a/python/Chapter 1/Question1_2/testrevstr.py b/python/Chapter_1/Question1_2/testrevstr.py similarity index 100% rename from python/Chapter 1/Question1_2/testrevstr.py rename to python/Chapter_1/Question1_2/testrevstr.py diff --git a/python/Chapter 1/Question1_3/ChapQ1.3.py b/python/Chapter_1/Question1_3/ChapQ1.3.py similarity index 100% rename from python/Chapter 1/Question1_3/ChapQ1.3.py rename to python/Chapter_1/Question1_3/ChapQ1.3.py diff --git a/python/Chapter 1/Question1_3/anagram.py b/python/Chapter_1/Question1_3/anagram.py similarity index 100% rename from python/Chapter 1/Question1_3/anagram.py rename to python/Chapter_1/Question1_3/anagram.py diff --git a/python/Chapter 1/Question1_3/testanagram.py b/python/Chapter_1/Question1_3/testanagram.py similarity index 100% rename from python/Chapter 1/Question1_3/testanagram.py rename to python/Chapter_1/Question1_3/testanagram.py diff --git a/python/Chapter 1/Question1_4/ChapQ1.4.py b/python/Chapter_1/Question1_4/ChapQ1.4.py similarity index 100% rename from python/Chapter 1/Question1_4/ChapQ1.4.py rename to python/Chapter_1/Question1_4/ChapQ1.4.py diff --git a/python/Chapter 1/Question1_4/Q1_4.py b/python/Chapter_1/Question1_4/Q1_4.py similarity index 100% rename from python/Chapter 1/Question1_4/Q1_4.py rename to python/Chapter_1/Question1_4/Q1_4.py diff --git a/python/Chapter 1/Question1_4/replace.py b/python/Chapter_1/Question1_4/replace.py similarity index 100% rename from python/Chapter 1/Question1_4/replace.py rename to python/Chapter_1/Question1_4/replace.py diff --git a/python/Chapter 1/Question1_4/testreplace.py b/python/Chapter_1/Question1_4/testreplace.py similarity index 100% rename from python/Chapter 1/Question1_4/testreplace.py rename to python/Chapter_1/Question1_4/testreplace.py diff --git a/python/Chapter 1/Question1_5/ChapQ1.5.py b/python/Chapter_1/Question1_5/ChapQ1.5.py similarity index 100% rename from python/Chapter 1/Question1_5/ChapQ1.5.py rename to python/Chapter_1/Question1_5/ChapQ1.5.py diff --git a/python/Chapter 1/Question1_5/compress.py b/python/Chapter_1/Question1_5/compress.py similarity index 100% rename from python/Chapter 1/Question1_5/compress.py rename to python/Chapter_1/Question1_5/compress.py diff --git a/python/Chapter 1/Question1_5/testcompress.py b/python/Chapter_1/Question1_5/testcompress.py similarity index 100% rename from python/Chapter 1/Question1_5/testcompress.py rename to python/Chapter_1/Question1_5/testcompress.py diff --git a/python/Chapter 1/Question1_6/ChapQ1.6.py b/python/Chapter_1/Question1_6/ChapQ1.6.py similarity index 100% rename from python/Chapter 1/Question1_6/ChapQ1.6.py rename to python/Chapter_1/Question1_6/ChapQ1.6.py diff --git a/python/Chapter 1/Question1_6/rotateimg.py b/python/Chapter_1/Question1_6/rotateimg.py similarity index 100% rename from python/Chapter 1/Question1_6/rotateimg.py rename to python/Chapter_1/Question1_6/rotateimg.py diff --git a/python/Chapter 1/Question1_6/testrotate.py b/python/Chapter_1/Question1_6/testrotate.py similarity index 100% rename from python/Chapter 1/Question1_6/testrotate.py rename to python/Chapter_1/Question1_6/testrotate.py diff --git a/python/Chapter 1/Question1_7/ChapQ1.7.py b/python/Chapter_1/Question1_7/ChapQ1.7.py similarity index 100% rename from python/Chapter 1/Question1_7/ChapQ1.7.py rename to python/Chapter_1/Question1_7/ChapQ1.7.py diff --git a/python/Chapter 1/Question1_8/ChapQ1.8.py b/python/Chapter_1/Question1_8/ChapQ1.8.py similarity index 100% rename from python/Chapter 1/Question1_8/ChapQ1.8.py rename to python/Chapter_1/Question1_8/ChapQ1.8.py diff --git a/python/Chapter 2/Question2_1.py b/python/Chapter_2/Question2_1.py similarity index 100% rename from python/Chapter 2/Question2_1.py rename to python/Chapter_2/Question2_1.py diff --git a/python/Chapter 2/Question2_2.py b/python/Chapter_2/Question2_2.py similarity index 100% rename from python/Chapter 2/Question2_2.py rename to python/Chapter_2/Question2_2.py diff --git a/python/Chapter 2/Question2_3.py b/python/Chapter_2/Question2_3.py similarity index 100% rename from python/Chapter 2/Question2_3.py rename to python/Chapter_2/Question2_3.py diff --git a/python/Chapter 2/Question2_4.py b/python/Chapter_2/Question2_4.py similarity index 100% rename from python/Chapter 2/Question2_4.py rename to python/Chapter_2/Question2_4.py diff --git a/python/Chapter 2/Question2_5.py b/python/Chapter_2/Question2_5.py similarity index 100% rename from python/Chapter 2/Question2_5.py rename to python/Chapter_2/Question2_5.py diff --git a/python/Chapter 2/Question2_6.py b/python/Chapter_2/Question2_6.py similarity index 100% rename from python/Chapter 2/Question2_6.py rename to python/Chapter_2/Question2_6.py diff --git a/python/Chapter 2/Question2_7.py b/python/Chapter_2/Question2_7.py similarity index 100% rename from python/Chapter 2/Question2_7.py rename to python/Chapter_2/Question2_7.py diff --git a/python/Chapter 2/classes/LinkedList.py b/python/Chapter_2/classes/LinkedList.py similarity index 100% rename from python/Chapter 2/classes/LinkedList.py rename to python/Chapter_2/classes/LinkedList.py diff --git a/python/Chapter 2/classes/LinkedList.pyc b/python/Chapter_2/classes/LinkedList.pyc similarity index 100% rename from python/Chapter 2/classes/LinkedList.pyc rename to python/Chapter_2/classes/LinkedList.pyc diff --git a/python/Chapter 2/classes/__init__.py b/python/Chapter_2/classes/__init__.py similarity index 100% rename from python/Chapter 2/classes/__init__.py rename to python/Chapter_2/classes/__init__.py diff --git a/python/Chapter 2/classes/__init__.pyc b/python/Chapter_2/classes/__init__.pyc similarity index 100% rename from python/Chapter 2/classes/__init__.pyc rename to python/Chapter_2/classes/__init__.pyc diff --git a/python/Chapter 3/Question3_1/Q3_1.py b/python/Chapter_3/Question3_1/Q3_1.py similarity index 100% rename from python/Chapter 3/Question3_1/Q3_1.py rename to python/Chapter_3/Question3_1/Q3_1.py diff --git a/python/Chapter 3/Question3_2/ChapQ3.2.py b/python/Chapter_3/Question3_2/ChapQ3.2.py similarity index 100% rename from python/Chapter 3/Question3_2/ChapQ3.2.py rename to python/Chapter_3/Question3_2/ChapQ3.2.py diff --git a/python/Chapter 3/Question3_3/Q3_3.py b/python/Chapter_3/Question3_3/Q3_3.py similarity index 100% rename from python/Chapter 3/Question3_3/Q3_3.py rename to python/Chapter_3/Question3_3/Q3_3.py diff --git a/python/Chapter 3/Question3_4/Q3_4.py b/python/Chapter_3/Question3_4/Q3_4.py similarity index 100% rename from python/Chapter 3/Question3_4/Q3_4.py rename to python/Chapter_3/Question3_4/Q3_4.py diff --git a/python/Chapter 3/Question3_5/3_5.py b/python/Chapter_3/Question3_5/3_5.py similarity index 100% rename from python/Chapter 3/Question3_5/3_5.py rename to python/Chapter_3/Question3_5/3_5.py diff --git a/python/Chapter 3/Question3_5/ChapQ3.5.py b/python/Chapter_3/Question3_5/ChapQ3.5.py similarity index 100% rename from python/Chapter 3/Question3_5/ChapQ3.5.py rename to python/Chapter_3/Question3_5/ChapQ3.5.py diff --git a/python/Chapter 3/Question3_6/ChapQ3.6.py b/python/Chapter_3/Question3_6/ChapQ3.6.py similarity index 100% rename from python/Chapter 3/Question3_6/ChapQ3.6.py rename to python/Chapter_3/Question3_6/ChapQ3.6.py diff --git a/python/Chapter 3/Question3_7/ChapQ3.7.py b/python/Chapter_3/Question3_7/ChapQ3.7.py similarity index 100% rename from python/Chapter 3/Question3_7/ChapQ3.7.py rename to python/Chapter_3/Question3_7/ChapQ3.7.py diff --git a/python/Chapter 4/Question4_1/ChapQ4.1.py b/python/Chapter_4/Question4_1/ChapQ4.1.py similarity index 100% rename from python/Chapter 4/Question4_1/ChapQ4.1.py rename to python/Chapter_4/Question4_1/ChapQ4.1.py diff --git a/python/Chapter 4/Question4_2/ChapQ4.2.py b/python/Chapter_4/Question4_2/ChapQ4.2.py similarity index 100% rename from python/Chapter 4/Question4_2/ChapQ4.2.py rename to python/Chapter_4/Question4_2/ChapQ4.2.py diff --git a/python/Chapter 4/Question4_3/ChapQ4.3.py b/python/Chapter_4/Question4_3/ChapQ4.3.py similarity index 100% rename from python/Chapter 4/Question4_3/ChapQ4.3.py rename to python/Chapter_4/Question4_3/ChapQ4.3.py diff --git a/python/Chapter 4/Question4_4/ChapQ4.4.py b/python/Chapter_4/Question4_4/ChapQ4.4.py similarity index 100% rename from python/Chapter 4/Question4_4/ChapQ4.4.py rename to python/Chapter_4/Question4_4/ChapQ4.4.py diff --git a/python/Chapter 4/Question4_5/ChapQ4.5.py b/python/Chapter_4/Question4_5/ChapQ4.5.py similarity index 100% rename from python/Chapter 4/Question4_5/ChapQ4.5.py rename to python/Chapter_4/Question4_5/ChapQ4.5.py diff --git a/python/Chapter 4/Question4_6/ChapQ4.6.py b/python/Chapter_4/Question4_6/ChapQ4.6.py similarity index 100% rename from python/Chapter 4/Question4_6/ChapQ4.6.py rename to python/Chapter_4/Question4_6/ChapQ4.6.py diff --git a/python/Chapter 4/Question4_7/BinaryTreeNode.py b/python/Chapter_4/Question4_7/BinaryTreeNode.py similarity index 100% rename from python/Chapter 4/Question4_7/BinaryTreeNode.py rename to python/Chapter_4/Question4_7/BinaryTreeNode.py diff --git a/python/Chapter 4/Question4_7/Q4_7.py b/python/Chapter_4/Question4_7/Q4_7.py similarity index 100% rename from python/Chapter 4/Question4_7/Q4_7.py rename to python/Chapter_4/Question4_7/Q4_7.py diff --git a/python/Chapter 4/Question4_8/ChapQ4.8.py b/python/Chapter_4/Question4_8/ChapQ4.8.py similarity index 100% rename from python/Chapter 4/Question4_8/ChapQ4.8.py rename to python/Chapter_4/Question4_8/ChapQ4.8.py diff --git a/python/Chapter 4/Question4_9/BinaryTreeNode.py b/python/Chapter_4/Question4_9/BinaryTreeNode.py similarity index 100% rename from python/Chapter 4/Question4_9/BinaryTreeNode.py rename to python/Chapter_4/Question4_9/BinaryTreeNode.py diff --git a/python/Chapter 4/Question4_9/Q4_9.py b/python/Chapter_4/Question4_9/Q4_9.py similarity index 100% rename from python/Chapter 4/Question4_9/Q4_9.py rename to python/Chapter_4/Question4_9/Q4_9.py diff --git a/python/Chapter 9/Question9_01/staircase.py b/python/Chapter_9/Question9_01/staircase.py similarity index 100% rename from python/Chapter 9/Question9_01/staircase.py rename to python/Chapter_9/Question9_01/staircase.py diff --git a/python/Chapter 9/Question9_02/robot_paths.py b/python/Chapter_9/Question9_02/robot_paths.py similarity index 100% rename from python/Chapter 9/Question9_02/robot_paths.py rename to python/Chapter_9/Question9_02/robot_paths.py diff --git a/python/Chapter 9/Question9_03/magic_index.py b/python/Chapter_9/Question9_03/magic_index.py similarity index 100% rename from python/Chapter 9/Question9_03/magic_index.py rename to python/Chapter_9/Question9_03/magic_index.py diff --git a/python/Chapter 9/Question9_03/magic_index_followup.py b/python/Chapter_9/Question9_03/magic_index_followup.py similarity index 100% rename from python/Chapter 9/Question9_03/magic_index_followup.py rename to python/Chapter_9/Question9_03/magic_index_followup.py diff --git a/python/Chapter 9/Question9_04/subsets.py b/python/Chapter_9/Question9_04/subsets.py similarity index 100% rename from python/Chapter 9/Question9_04/subsets.py rename to python/Chapter_9/Question9_04/subsets.py diff --git a/python/Chapter 9/Question9_05/permutations.py b/python/Chapter_9/Question9_05/permutations.py similarity index 100% rename from python/Chapter 9/Question9_05/permutations.py rename to python/Chapter_9/Question9_05/permutations.py diff --git a/python/Chapter 9/Question9_06/parentheses.py b/python/Chapter_9/Question9_06/parentheses.py similarity index 100% rename from python/Chapter 9/Question9_06/parentheses.py rename to python/Chapter_9/Question9_06/parentheses.py diff --git a/python/Chapter 9/Question9_07/paint_fill.py b/python/Chapter_9/Question9_07/paint_fill.py similarity index 100% rename from python/Chapter 9/Question9_07/paint_fill.py rename to python/Chapter_9/Question9_07/paint_fill.py diff --git a/python/Chapter 9/Question9_08/change_making.py b/python/Chapter_9/Question9_08/change_making.py similarity index 100% rename from python/Chapter 9/Question9_08/change_making.py rename to python/Chapter_9/Question9_08/change_making.py diff --git a/python/Chapter 9/Question9_09/queens_problem.py b/python/Chapter_9/Question9_09/queens_problem.py similarity index 100% rename from python/Chapter 9/Question9_09/queens_problem.py rename to python/Chapter_9/Question9_09/queens_problem.py diff --git a/python/Chapter 9/Question9_10/tallest_stack.py b/python/Chapter_9/Question9_10/tallest_stack.py similarity index 100% rename from python/Chapter 9/Question9_10/tallest_stack.py rename to python/Chapter_9/Question9_10/tallest_stack.py diff --git a/python/Chapter 9/Question9_11/parenthesizing.py b/python/Chapter_9/Question9_11/parenthesizing.py similarity index 100% rename from python/Chapter 9/Question9_11/parenthesizing.py rename to python/Chapter_9/Question9_11/parenthesizing.py From 7d3ac42dd77e898a89097fbb8c0e4591cd72caf9 Mon Sep 17 00:00:00 2001 From: Piyush Sharma Date: Sat, 11 Mar 2017 09:29:51 -0800 Subject: [PATCH 2/2] Fix the formatting of the code to be PEP8 compliant. --- python/Chapter_1/Question1_5/ChapQ1.5.py | 69 +++++++++++++----------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/python/Chapter_1/Question1_5/ChapQ1.5.py b/python/Chapter_1/Question1_5/ChapQ1.5.py index 43eb48d1..cfc31877 100644 --- a/python/Chapter_1/Question1_5/ChapQ1.5.py +++ b/python/Chapter_1/Question1_5/ChapQ1.5.py @@ -1,33 +1,37 @@ -#Implement a method to perform basic string compression using the counts of repeated characters +# Implement a method to perform basic string compression using the counts of repeated characters -#aabcccccaaa would become a2blc5a3. +# aabcccccaaa would become a2blc5a3. -#do nothing if this would not make the string smaller. +# do nothing if this would not make the string smaller. def simpleCompress(compstring): - #Avoid using the + and += operators to accumulate a string within a loop. Since strings are immutable, this creates unnecessary temporary objects and results in quadratic rather than linear running time. Instead, add each substring to a list and ''.join the list after the loop terminates (or, write each substring to a cStringIO.StringIO buffer). - #Google python style guidelines http://google-styleguide.googlecode.com/svn/trunk/pyguide.html - outstring=[] - lastchar="" - charcount=0 + # Avoid using the + and += operators to accumulate a string within a loop. Since strings are immutable, + # this creates unnecessary temporary objects and results in quadratic rather than linear running time. + # Instead, add each substring to a list and ''.join the list after the loop terminates + # (or, write each substring to a cStringIO.StringIO buffer). + # Google python style guidelines http://google-styleguide.googlecode.com/svn/trunk/pyguide.html + outstring = [] + lastchar = "" + charcount = 0 for char in compstring: - if char==lastchar: + if char == lastchar: charcount += 1 else: if lastchar != "": outstring.append(lastchar + str(charcount)) charcount = 1 - lastchar=char - #final write + lastchar = char + # final write outstring.append(lastchar + str(charcount)) - outstring="".join(outstring) - if len(outstring)