Category: Source Code: Programing Source Code

Solving the Knapsack Problem with Code Examples

The Knapsack Problem is a classic optimization problem in computer science and mathematics. The goal is to maximize the value of items placed in a knapsack without exceeding its weight capacity. This problem has many variations, but the most common are: 0/1 Knapsack Problem: Each item can either be included or excluded. Fractional Knapsack Problem: Items can be divided to maximize value.

Read More

How to Send Email using PHP

A detailed guide on PHP mail sending options with examples of using the built-in mail function(), PHPMailer, Symfony, and third-party mail service providers such as Amazon SES, SendGrid and GetResponse.

Read More

Rock, Paper, Scissors Game in C++ [C++ Game]

This is a simple C++ program to demonstrate rock, paper, scissors game. In this game, players have to choose one of the three options to beat the opponent or the computer itself. The C++ code generates a random choice by creating a character to indicate that option. Options are: r is for ‘rock’, p is for ‘paper’, and s is for ‘scissors’.

Read More

LRU and FIFO L1 Cache Implementation using C

This is a C program to demonstrate cache mechanism by simulating a cache in C. The source code can run in any C Compiler with minor modifications if required. It can run on real memory traces as input to your cache simulator. We have implemented two cache replacement policies i.e. least recently used (LRU) and First-in first-out (FIFO) replacement policies.

Read More

Vigenere Encryption and Decryption in C++

The Vigenere cipher is a method of encrypting or decrypting alphabetic text by using a series of interwoven Caesar ciphers (Caesar Shift), based on the letters of a keyword. In cryptography, Caesar shift is one of the simplest known encryption techniques. It employs a form of polyalphabetic substitution, which is using multiple substitution alphabets.

Read More

The Phoenix Project
Transform your IT and business with The Phoenix Project – the gripping story that redefines how we think about DevOps and innovation!
View on Amazon