Lab3003
  • FacultyAlgorithmChallenge
  • README
  • Question Bank
  • Python Documentation
    • BetterMap
    • Board
    • Card
    • Circle
    • Deck
    • README.md
    • Guide For Bookmarklet
    • Hand
    • HashMap
    • Hist
    • Kangaroo
    • LinearMap
    • Markov
    • Point
    • PokerDeck
    • PokerHand
    • Rectangle
    • State
    • Test
    • ThinkPython
    • ThinkPython2
    • Time
    • Think Python
    • thinkpython
  • Files
  • Image Files
  • lab
    • InsertSortTDD
    • countingBits
    • cs3003mergeSortLectureGuideLine
    • index_min
    • insort
    • One-line factorial function in Python
  • Manual for Python Lab
    • COURSE OBJECTIVES
    • 1_timelines
    • FDPNotes
    • PC-2_Python
    • lab1-kgashok.py
    • Lab 10 :Matrix Multiplication
    • Lab 11: Programs that take command line arguments (word count)
    • Lab 11: Programs that take command line arguments
    • Lab 12: Compute the most frequently used words from the text file
    • Lab 12: Find the most frequent words in a text read from a file
    • Lab 12a: File content sorter
    • Lab 2: Find the square root of a number (Newton’s method)
    • Lab 3: Compute power of a number (Exponentiation)
    • Lab 3: Exponentiation (power of a number)
    • lab4-binaraysearch-anvar.py
    • Solution for Binary Search
    • lab4-joelanandraj-binarysearch.py
    • Lab 4: Linear and Binary Search
    • lab4-lin-anvar.py
    • Linear Searcher
    • Lab 5 : find n prime numbers
    • lab6-kgashok.py
    • lab7-kgashok.py
    • lab8-kgashok.py
    • Lab 8: Selection and Insertion sort using Python
    • Merge Sort
    • Quick Sort
    • labSheet
    • pc0
    • sortPythonic
    • Sorting
  • misc
    • Bookmarklets
    • Guide For Bookmarklet
    • pythonResources
    • FDP for Python
    • Agenda for Workshop
      • Agenda
  • notes
    • Problem Set
    • InsertSortTDD
    • MergeSort
    • cs3003-unit1-notes
    • cs3003-unit3
    • cs3003-unit4-examples
    • Unit 4 Lists, Tuples and Dictionaries
    • cs3003insertsortLectureGuide
    • cs3003mergeSortLectureGuideLine
    • Designing and Delivering Effective Lectures
    • histogram.py
    • selectSortLectureGuide
  • Sandbox to try ThinkPy2 code
    • Code from ThinkPython Github repository
  • Important Topics
    • 3003-syllabus
    • GE8161 PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY L T P C
    • Unit II Version 2
    • Unit IV material
    • UNIT III CONTROL FLOW, FUNCTIONS
    • Unit 1 Algorithm Problem Solving
    • Unit_V_Notes
    • UpdatedSyllabus
    • glossary
    • glossaryGeneration.py
    • importantTopics-kgashok
    • memCSV
    • Tower of Hanoi
    • Notes for Unit 2 - Illustrative programs
    • unit5-updated_notes
    • unit_1_notes
    • Unit 3 Control Flow Version 1
    • unit 3
      • UNIT III CONTROL FLOW, FUNCTIONS
    • unit_i_img
Powered by GitBook
On this page
  • Problem Set PC-2
  • Learn TDD the fun way
  • Step 1
  • Step 2
  • Bonus
  • Further Steps
  • Advanced
  • Misc
  • Misc 2
  • Misc 3
  • Motivations
  • If You Are a Student Interested in a Software Job…
  1. Manual for Python Lab

PC-2_Python

Problem Set PC-2

  • PC-1 assessment http://j.mp/greet10CC

  • Always think on paper, first! Pattern problem - http://j.mp/ctreeCC

  • Warm up 1 - http://j.mp/secondBiggest and http://j.mp/secondBiggestValue

  • Warm up 2 - http://j.mp/fizzBuzzC and http://j.mp/fizzBuzzMixC on CyberDojo

Learn TDD the fun way

Step 1

  • Sequence practice http://j.mp/indexMinCC and http://j.mp/twoPoints

    • How to calculate total route distance over multiple points?

    • Which taxi to dispatch?

  • String practice http://j.mp/rotateCC

  • Lab practice - http://j.mp/tileSolverCC

    • perfect for learning the application of an algorithm. Interestingly, the solution can be reduced to one line, which incidentally, can also be a non-typical python code statement.

Step 2

  • Dictionary concepts http://j.mp/reverseDictionary

    • How to maintain a list in alphabetical order?

    • and http://j.mp/luckyNumCC and http://j.mp/duplicateCountCC

  • Conditional practice and Argument handling http://j.mp/cycleThrough3

  • Loop (3 ways) through Lists http://j.mp/getMaxCC

Bonus

  • http://j.mp/selfConverge - first iteration mode, and then recursion mode - because it will require default argument values.

  • http://j.mp/spyPlaneCD - come with the most elegant code for this

  • http://j.mp/permutePython and/or on CyberDojo

  • http://j.mp/friendsCC - friends of friends

  • http://j.mp/unionListCC - merge two lists into one, remove duplicates

Further Steps

  • Lab Practice - http://j.mp/transposeCC and/or http://j.mp/matrixMultiplyCC

  • Lab Practice - http://j.mp/selectionSortCC and/or http://j.mp/selectSortChallenge on CD

  • Lab Practice - http://j.mp/insertionSortCC

Advanced

The "Thala-Ajith" movie ticketing challenge. Pick an avatar at http://j.mp/ticketsCD

Phase 1: Just solve the problem. Phase 2: What if we had some new denominations to the choices?

Misc

  • subset and subseq equivalent in Python - http://j.mp/subProblems

    • pangram - determine whether a sentence is a pangram

    • http://bit.ly/subsetSubseq - for contrasting between subset, substring and subsequence

  • find whether a string has duplicates

    • determine whether a string is an isogram

Misc 2

  • partial pangrams

  • higher order isograms

Misc 3

    • https://j.mp/kmpAlgorithmVideo by NPTEL

Motivations

  • PC2 is all about learning a threshold concept (pointers in C, problem solving using TDD in Python, patterns like MVC in C++/Java, promises in JavaScript)

  • Perceptual adaptive learning module (PALM) is the intended pedagogy

    • How does this compare to Nifty Assignments from SIGCSE?

  • PC2 is a progressive challenging set of problems to use for practicing TDD skills on a regular basis. New ways of thinking can be ingrained into one's repertoire of skills only when they are practiced regularly.

  • PC2 is useful for refreshing the novice programmer about the syntax of the language, including some of the unique and important constructs and basic data types of the Python language, including *kwargs, dictionaries, etc.

  • PC2 is useful as an assessment tool to validate whether students have really internalized the 1st semester paper of CS3003.

  • What is this anyway?

    • It is all about threshold concepts, and how to learn it. "Learn how to learn" is another takeaway!

  • PC2 (past the Misc sections) persuades you to choose an algorithm (for e.g. KMP algorithm) of your choice, and really become passionate about it!

If You Are a Student Interested in a Software Job…

Dorai Thodla

If you are a student and is really interested in a software job, some actual practice may help. Here are a few things you can do:

  • Just learning the standard languages they teach you in your institution is not enough. Practice and feel the joy of programming. You will know whether you like it or not. If you enjoy it, it will show, when you talk to people about it.

  • Start early – even in the very first year of your college. Just spend a few hours each week.

  • Pick an easy language to learn like Python or Ruby.

  • Learn to program by writing lots of small useful tools, games, apps. Visit https://github.com/kgisl/project-ideas

  • Share your programs with others and ask for feedback. Ask them whether they find it useful.

  • Share the code on github (it is free) or other repositories.

  • Post the link on Geek forums and request feedback too (but please don’t spam the groups). Put your github link in your profile, email signature and on your resume.

  • Don’t get upset if people criticize it. All feedback is good when you are learning.

  • Don’t take it personally. If some one cares enough to look at it and give you comments, that is a good thing.

  • Once in a while, take all the stuff you have written, factor out common code and create libraries/modules that you can reuse. Go back and change the programs to reuse these libraries. Repeat 2-6 as many times as you can, every week, every month.

  • Look at some cool open source projects and join in. Contribute in a small way. Keep exploring.

  • When you attend tech interviews, tell them about the stuff you have written. Point them to the links. Share the feedback your received and your journey of learning and iterating.

  • Don’t worry that if you train in programming language X but the job is for Y that you may not qualify.

  • Except in a few cases, companies are trying to hire smart people with lots of initiative, who are willing to constantly learn and explore.

  • It may be a good idea to earn while you learn. It is not just the money, but it is the feeling that someone values what you have done enough to pay for it.

  • Find a master programmer to work with. How do you know they are masters? Pretty simple. Take a piece of code they have written and read it. It will read like an essay – elegant, beautiful and clear.

  • A couple of years of apprentice with such great programmers will do more to accelerate your learning than any other activity.

PreviousFDPNotesNextlab1-kgashok.py

Last updated 3 years ago

codify the substring search algorithm

Knuth-Morris-Pratt
what