Code Monkey home page Code Monkey logo

c4everyone's Introduction

Coding for Everyone, C and C ++

Welcome to my GitHub repository for the C and C++ Programming Specialization offered by the University of California, Irvine on Coursera. In this repository, you'll find my completed assignments, projects and some sparse notes.

Motivation

I embarked on this journey to delve deeper into the world of programming and broaden my skills beyond Python. C and C++ offer powerful tools and insights that complement my existing knowledge, making me a more versatile programmer. Moreover, learning new concepts and languages is not just a pursuit of knowledge but also an enjoyable challenge that I embrace with enthusiasm.

About the Specialization

The C and C++ Programming Specialization provided a comprehensive introduction to these languages, covering fundamental concepts, data structures, algorithms, and best practices. Through a series of hands-on projects and assignments, I gained practical experience and honed my problem-solving skills.

The end of the course focussed on Graph theory and AI which I learned much about.

Repository Contents

  • Fundamentals: Here you will find my solutions to the assignments of the first course in the series, fundamentals.
  • StructuredProgramming : Here you will find my solutions to the assignments of the second course in the series, structured programming.
  • Cpp4cdev: Here you will find my solutions and notes of the third and fourth course in the series.

Feel free to explore the contents of this repository and learn alongside me. If you have any questions, suggestions, or feedback, don't hesitate to reach out. Let's continue learning and growing together!

Happy coding!

Fundamentals

The fundamentals folder contains the material and solutions for couse one. It covered the very basics and some core concepts of the c language.

Week 1

Here you'll find the assignment for Week 1. This weeks lectures covered:

  • Simple input/output operations using printf and scanf.
  • Basics of compiling C programs.
  • Introduction to debugging C code.

Week 2

Here you'll find the assignment for Week 2. This weeks lectures covered:

  • Introduction to keywords and identifiers in C programming.
  • Understanding fundamental operations and operators in C, including arithmetic, relational, logical, and bitwise operators.
  • Exploring expressions and their role in C programming.
  • Understanding the sizeof operator and its role in determining the size of data types.
  • Exploring the int data type and its usage in C programming.
  • Introduction to the float data type and its usage for representing floating-point numbers.

Week 3

Here you'll find the assignment for Week 3. This weeks lectures covered:

  • Practice with input/output operations, reinforcing concepts from Week 2.
  • Further exploration of keywords, identifiers, expressions, and the sizeof operator.
  • Introduction to the switch statement and its usage for multi-way branching in C programming.
  • Understanding the comma operator and its role in sequence expressions.

Week 4

Here you'll find the assignment for Week 4. This weeks lectures covered:

  • Introduction to functions, including their definition and usage in C programming.
  • Understanding function prototypes and their importance in declaring functions before their use.
  • Exploring the concept of recursion and its application in solving problems.
  • Understanding scope rules in C programming, including local, global, and block scope.
  • Differentiating between call by value and call by reference in function parameter passing.

Week 5

Here you'll find the assignment for Week 5. This weeks lectures covered:

  • Exploration of pointers, covering their syntax, usage, and memory management.
  • Understanding the concept of arrays, including their declaration, initialization, and manipulation.
  • Comprehensive coverage of call by reference, examining its implementation and advantages over call by value.

Structured Programming

Welcome to the Structured Programming section, the second part of the course where we delve deeper into the C language.

Week 1: Introduction to Enums, Preprocessor, and Assert Statement

Here you'll find the materials and assignments for Week 1, covering:

  • Introduction to enums (enumerated types) in C programming.
  • Understanding preprocessor directives, including #define, #include, and #ifdef.
  • Exploring the assert() statement for debugging and error handling.

Week 2: Structs and Stack Implementation

In Week 2, we explored the concept of structs and their implementation in C programming. Structs allow us to create custom data types by grouping together related variables, providing a convenient way to organize and manipulate data.

We also delved into the fundamental concept of stacks and how to implement them using structs. Stacks are abstract data types that follow the Last In, First Out (LIFO) principle, making them suitable for various applications such as expression evaluation, function call management, and more.

Structs in C:

  • Introduction to structs and their syntax in C programming.
  • Understanding how structs allow us to define custom data types.
  • Exploring practical examples of struct usage, including defining employee records, cards in a deck, and more.

Stack Implementation:

  • Understanding the stack data structure and its operations: push, pop, and isEmpty.
  • Hands-on practice with implementing a stack using structs in C.
  • Real-world applications of stacks and their significance in computer science.

Week 3: Linked Lists and Binary Search Trees

In Week 3, we explored linked lists and their manipulation, along with an introduction to binary search trees (BSTs) and their properties. Here's what we covered:

Linked Lists:

  • Introduction to singly linked lists and their implementation in C.
  • Working with linked list nodes and pointers.
  • Creating, traversing, and printing linked lists.
  • Operations on linked lists, such as insertion, deletion, and searching.

Understanding Binary Search Trees (BSTs):

  • Understanding binary search trees (BSTs) and their properties.
  • Implementing BSTs in C and performing common operations such as insertion, deletion, and traversal.

Week 4: File I/O and Command Line Arguments

In Week 4, we focused on two important topics: File I/O and working with command line arguments (argc and argv). Here's what we covered:

File I/O:

  • Introduction to File I/O operations in C programming.
  • Reading data from files using fopen(), fscanf(), and fclose() functions.
  • Writing data to files using fprintf() and fwrite() functions.
  • Handling file errors and checking for file existence.

Command Line Arguments:

  • Understanding the argc (argument count) and argv (argument vector) parameters in the main() function.
  • Parsing command line arguments and using them to control program behavior.
  • Practical examples of command line argument usage in C programs.

Rational Numbers:

  • Implementation of basic arithmetic operations on rational numbers (addition, subtraction, multiplication, division).
  • Reading rational numbers from a file and performing arithmetic operations.
  • Creating and traversing a binary tree structure from integer pairs read from a file.

C++ for C Programmers A + B

In this section, I'll summarize the third and fourth parts of the course, which focus on transitioning from C to C++, leveraging object-oriented programming (OOP) concepts, and exploring the advancements and improvements offered by C++ over C. Let's dive into the details:

Week 1: Introduction to C++

In Week 1, we delved into the following key topics:

  • Introduction to Object-Oriented Programming (OOP) concepts.
  • Conversion of C code to C++.
  • Highlighting the significant differences and improvements of C++ over C.

Week 2:

In Week 2, we explored the following topics:

  • Introduction to classes in C++ including constructors and destructors.
  • Understanding the concept of operator overloading and its implementation in C++.
  • Exploring the concept of generic functions and their usage in C++ programming.
  • Learning about enums in C++ and how they provide a way to define a set of named integral constants representing enumerators.
  • An introductory session on graph theory, its significance, and basic concepts.

Week 3:

In Week 3 we explored the following topics:

  • Deep-dive into classes in C++
  • Exploring graph theory and dijkstra algorithm
  • Introduction to priority queues
  • Homework which combined all the concepts above

Week 4 More Graph Theory:

In Week 4 we explored the following topics:

  • Minimal Spanning Tree Algorithms
  • Overloading Functions and understanding how the compiler decides which code to run
  • Intro to STL
  • STL Containers
  • STL Iterators
  • STL Algorithms

Week 5: Exam

Only the exam was done in this week

  • Exam

Week 6: Start of Course B

Week 6 started course B of the last leg of the Course. This week covered:

  • Deeper dive into the STL
  • Deep dive into container types
  • Deep dive into iterator types and their differences
  • Deep dive into algorithms
  • Introduction to Lambda expressions/functions

Week 7: Game of Hex

In Week 7, we focused on the game of Hex and its implementation using graph theory. Here's what we covered:

Implementing Game of Hex:

  • We implemented the game of Hex, a two-player strategy board game.
  • The game involved creating a hexagonal grid and allowing players to place their stones on the grid.
  • The objective of the game was to create a connected path of stones from one side of the board to the opposite side.

Using Graph Theory:

  • We utilized graph theory concepts to represent the game board and the connections between the stones.
  • Graph theory allowed us to efficiently determine the winning condition and check for connected paths.

Implementing a Smart AI Opponent:

  • We implemented a smart AI opponent for the game of Hex.
  • The AI opponent utilized various strategies and algorithms to make intelligent moves and compete against human players.

Monte Carlo Simulation:

  • We used Monte Carlo simulation to generate a smart AI agent for the game of Hex.
  • Monte Carlo simulation involved running multiple random simulations of the game to determine the best move in a given situation.

Overall, Week 7 provided an exciting opportunity to apply graph theory, implement the game of Hex, and create intelligent AI opponents using various strategies and algorithms.

c4everyone's People

Contributors

matzelopi avatar

Watchers

 avatar

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.