Posts

BT 4

  // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract StudentRegistry {     // Structure to store student data     struct Student {         string name;         uint256 age;     }     // Array to store multiple students     Student[] private students;       // Event to log Ether received     event ReceivedEther(address indexed sender, uint256 value);       // Receive function to accept Ether     receive() external payable {         emit ReceivedEther(msg.sender, msg.value);     }     // Fallback function     fallback() external payable {         emit ReceivedEther(msg.sender, msg.value);     }     // Function to add student data     function addStudent(string memory name, uint256 age) pub...

BT 3

  // SPDX-License-Identifier: MIT pragma solidity ^0.8.0;   contract Bank {     // Mapping of each user's address to their account balance     mapping(address => uint) public balances;       // Deposit Ether into your account     function deposit() public payable {         balances[msg.sender] += msg.value;     }       // Withdraw specified Ether amount from your account     function withdraw(uint _amount) public {         require(balances[msg.sender] >= _amount, "Insufficient balance");         balances[msg.sender] -= _amount;           // Transfer the Ether back to the sender         (bool sent, ) = msg.sender.call{value: _amount}("");         require(sent, "Transaction failed");     }       // Get t...

ML 4

  ipynb File Dataset

ML 3

  ipynb File

ML 2

  ipnyb File Dataset

ML 1

ipynb File   Datest

DAA 4

CODE # 8-Queens Problem using Backtracking  N = 8 def printBoard(board):     for row in board:         print(row) def isSafe(board, row, col):     for i in range(row):         if board[i][col] == 1 or \            (col - (row - i) >= 0 and board[i][col - (row - i)] == 1) or \            (col + (row - i) < N and board[i][col + (row - i)] == 1):             return False     return True def solve(board, row):     if row == N:         print("\nFinal 8-Queens Matrix:")         printBoard(board)         return True     for col in range(N):         if isSafe(board, row, col):             board[row][col] = 1             if solve(board, row + 1):       ...