Jalalabad Gas Transmission and Distribution System Ltd
Post: Assistant Engineer (CSE)
Exam Date: 08/10/2021Exam Taker: BUET
#include <iostream>
using namespace std;
int f(int *arr, int size) {
int x = 0;
for (int i = 0; i < size; i++) {
x = x ^ *(arr + i);
}
return x;
}
int main() {
int arr[] = {0, 1, 1, 0, 1, 1, 0, 1};
cout << f(arr, 2) <<f(arr, 3) << f(arr, 5) <<f(arr, 8) << endl;
return 0;
}
Answer: 1011.
Explanation:
f ফাংশনটি অ্যারের প্রথম size এলিমেন্টের XOR করে রিটার্ন করছে।
Step-by-step Calculation:
1) f(arr, 2)
arr[0] = 0
arr[1] = 1
XOR = 0 ^ 1 = 1
2) f(arr, 3)
arr[0] = 0
arr[1] = 1
arr[2] = 1
XOR = 0 ^ 1 ^ 1 = (0 ^ 1) ^ 1 = 1 ^ 1 = 0
3) f(arr, 5)
arr[0] = 0
arr[1] = 1
arr[2] = 1
arr[3] = 0
arr[4] = 1
XOR = 0 ^ 1 ^ 1 ^ 0 ^ 1
= (0 ^ 1) ^ 1 ^ 0 ^ 1
= 1 ^ 1 ^ 0 ^ 1
= 0 ^ 0 ^ 1
= 0 ^ 1 = 1
4) f(arr, 8)
arr = {0, 1, 1, 0, 1, 1, 0, 1}
XOR = 0 ^ 1 ^ 1 ^ 0 ^ 1 ^ 1 ^ 0 ^ 1
Stepwise:
0 ^ 1 = 1
1 ^ 1 = 0
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 1 = 0
0 ^ 0 = 0
0 ^ 1 = 1
So overall XOR = 1
$chmod=x-x-x jgtdsl.txtIn AI, especially in the context of LSTM (Long Short-Term Memory) networks, the main gates are:
- Forget Gate
- Input Gate (sometimes called Update Gate)
- Output Gate
These gates control the flow of information inside the LSTM cell, helping it to remember or forget information over time.
These gates control the flow of information inside the LSTM cell, helping it to remember or forget information over time.
ACID Properties in DBMS
ACID is an acronym that represents four essential properties of database transactions. These properties ensure data integrity, reliability, and consistency in a database system.
1) Atomicity
Atomicity means a transaction is treated as a single unit. Either all operations of the transaction are completed successfully, or none of them are executed. If any error occurs, the transaction is rolled back, preventing partial updates.
2) Consistency
Consistency ensures that a transaction moves the database from one valid state to another valid state. All integrity constraints, rules, and triggers must be satisfied. If any rule is violated, the transaction is rejected.
3) Isolation
Isolation ensures that multiple concurrent transactions do not affect each other. Each transaction executes as if it is the only one running in the system, even though they may run simultaneously.
4) Durability
Durability guarantees that once a transaction is successfully committed, its changes are permanent. Even if a system failure occurs afterward, the committed data will not be lost.
In short, ACID properties make database transactions secure, reliable, and free from data corruption.
DBMS-এ ACID Properties
ACID হলো একটি acronym যা database transaction-এর চারটি গুরুত্বপূর্ণ বৈশিষ্ট্য নির্দেশ করে। এই বৈশিষ্ট্যগুলো data integrity, reliability এবং consistency নিশ্চিত করে।
1) Atomicity
Atomicity বোঝায় একটি transaction একটি একক unit হিসেবে কাজ করে। অর্থাৎ transaction-এর সব operation সফলভাবে সম্পন্ন হবে, নাহলে একটিও কার্যকর হবে না। কোনো error হলে transaction rollback হয় এবং আংশিক update প্রতিরোধ করা হয়।
2) Consistency
Consistency নিশ্চিত করে যে একটি transaction database-কে একটি valid state থেকে আরেকটি valid state-এ নিয়ে যায়। সব integrity constraint, rule এবং trigger বজায় রাখতে হবে। কোনো নিয়ম ভঙ্গ হলে transaction অনুমোদিত হবে না।
3) Isolation
Isolation নিশ্চিত করে যে একাধিক concurrent transaction একে অপরকে প্রভাবিত করবে না। প্রতিটি transaction এমনভাবে execute হয় যেন এটি একাই system-এ চলছে।
4) Durability
Durability নিশ্চিত করে যে একবার transaction commit হলে তার পরিবর্তন স্থায়ীভাবে সংরক্ষিত হয়। পরে system crash হলেও committed data হারিয়ে যায় না।
সংক্ষেপে, ACID properties database transaction-কে নির্ভরযোগ্য, সুরক্ষিত এবং data corruption বা loss থেকে রক্ষা করে।
Answer:
Explanation:

