GithubHelp home page GithubHelp logo

c-past-questions's Introduction

c-past-questions

C past papers and other practice questions at Imperial. I didn't look at other peoples code when first attempting these. Attempt the questions first, and only have a look if you're blocked.

Want starter files? Login to a IC machine (ssh [email protected]), then cd ~wjk/public_html/C++Intro/, then find the files in project folers e.g. cd river

Or alternatively, to use sftp to download all the files: sftp [email protected], then cd /homes/wjk/public_html/C++Intro, then get -r sonnet

Want to contribute?

Either fork the repo and share it with others, or write new questions (e.g. scrabble and create a PR! Now that's some git practice for MSc students. )

Notable questions:

  • Stamp: Loading in an entire file to be hashed: I had to google it: using file.seekg(0, file.end), file.tellg, file.seekg(0, file.beg), char* contents = new char[file_size], file.read(contents, file_size).
  • Tube: lots of logic in Q3, so little time
  • Unassessed questions
    • Q3-palindrome/anagram: Requires sorting algorithm
    • Q5-Piglatin: Reading in characters (.get()) worked well. Reading in words (>>) went badly.
    • Q2-soundex: Count function logic is messy
    • Tokenizing sentences/ strings into substring with strtok(sentence, " "), strtok(NULL, sentence) while token != NULL.
  • Doublets: Q4 of doublets has performance requirements, especially reaching 12 steps for find_chain()

Relatively easy questions

  • Maze
  • Playfair
  • Minesweeper (apart from some recursion logic at the end)
  • Many unassessed questions

Useful resources:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.