Telegram Web
إ₰...👨🏻‍💻..👩🏻‍💻...₰❥

https://www.mutaz.net/free-programs/download/?1208


•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @language_barmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•

.
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#Binary_Tree
خــوارزمــيات الاشـجار الثنــائية:-
1⃣ كــود #اضــافـة العقد والأبناء.
2⃣كــود #طــباعــة العناصر مرتبة.
3⃣كــود #البــحـث عن عنصر بالأشجار الثنائية.
4⃣كــود #ايــجـاد اكبر واصغر عنصر بالشجرة.
5⃣كــود #تــرتيب الشجرة بطرقها الثلاث
preorder , inorder , postorder
6⃣كــود #حــذف عقدة من الشجرة سواء كانت تحمل ...
one child ,no child , two child

#include <iostream>
using namespace std;

struct node
{
int data;
node *left;
node *right;
};

node *NewNode(int data)
{
node *Node = new node;
Node->data = data;
Node->left = NULL;
Node->right = NULL;

return Node;
}

node *insertNode(node *&root, int val)
{
if (root == NULL)
{
node *newNode = NewNode(val);
root = newNode;
}

else if (val <= root->data)
root->left = insertNode(root->left, val);
else
root->right = insertNode(root->right, val);

return root;
}

void print(node *root)
{
if (root != NULL)
{
print(root->left);
cout << root->data << " ";
print(root->right);
}
}

node *search(node *root, int data)
{
if (root == NULL)
{
return NULL;
}
else if (root->data == data)
{
return root;
}

else if (data < root->data)
{
return search(root->left, data);
}
else if (data > root->data)
{
return search(root->right, data);
}
}

void postorder(node *root)
{
if (root)
{
postorder(root->left);
postorder(root->right);
cout << root->data << " ";
}
}

void Inorder(node *root)
{
if (root)
{
Inorder(root->left);
cout << root->data << " ";
Inorder(root->right);
}
}

void preorder(node *root)
{
if (root)
{
cout << root->data << " ";
preorder(root->left);
preorder(root->right);
}
}

node *findMin(node *root)
{
node *temp = root;
while (temp->left != NULL)
temp = temp->left;
return temp;
}

node *findMax(node *root)
{
node *temp = root;
while (temp->right != NULL)
temp = temp->right;
cout << temp->data;
return temp;
}

node *deleteNode(node *root, int data)
{
if (root == NULL)
return root;

else if (data < root->data)
root->left = deleteNode(root->left, data);

else if (data > root->data)
root->right = deleteNode(root->right, data);

else
{
//case 1 ....> No child
if (root->left == NULL && root->right == NULL)
{
delete root;
root = NULL;
}

//case 2 .....> One child
else if (root->left == NULL)
{
node *temp = root;
root = root->right;
delete temp;
}
else if (root->right == NULL)
{
node *temp = root;
root = root->left;
delete temp;
}

//case 3 .......> Two child
else
{
node *temp = findMin(root->right);
root->data = temp->data;
root->right = deleteNode(root->right, temp->data);
}
}
return root;
}

int main()
{
node *root = NULL;
node *item;
insertNode(root, 5);
insertNode(root, 1);
insertNode(root, 8);
insertNode(root, 7);
insertNode(root, 2);
insertNode(root, 9);
insertNode(root, 50);
insertNode(root, 4);

cout << "Binary sorted Tree :-" << endl;
print(root);
cout << endl;

cout << endl
<< "postorder " << endl;
postorder(root);
cout << endl
<< "*-*-*-*-*-*-*-*-*-*-*-*";

cout << endl
<< "Inorder " << endl;
Inorder(root);
cout << endl
<< "*-*-*-*-*-*-*-*-*-*-*-*";

cout << endl
<< "preorder " << endl;
preorder(root);
cout << endl
<< "*-*-*-*-*-*-*-*-*-*-*-*" << endl;

cout << endl
<< "max element : ";
findMax(root);
cout << endl
<< "*-*-*-*-*-*-*-*-*-*-*-*" << endl;

int SearchValue;
cout << "enter the value :";
cin >> SearchValue;

item = search(root, SearchValue);
if (item == NULL)
cout << "Not found ..\n";
else
cout << "found..\n";

cout << "*-*-*-*-*-*-*-*-*-*-*-*" << endl;

cout << "delete element 9:-" << endl;
root = deleteNode(root, 9);
print(root);
cout << endl;

cout << "delete element 2 :-" << endl;
root = deleteNode(root, 2);
print(root);
cout << endl;

cout << "delete element 8 :-" << endl;
root = deleteNode(root, 8);
print(root);
cout << endl;

return 0;
}
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
إ₰...Output....₰❥

Binary sorted Tree :-
1 2 4 5 7 8 9 50

postorder
4 2 1 7 50 9 8 5
*-*-*-*-*-*-*-*-*-*-*-*
Inorder
1 2 4 5 7 8 9 50
*-*-*-*-*-*-*-*-*-*-*-*
preorder
5 1 2 4 8 7 9 50
*-*-*-*-*-*-*-*-*-*-*-*
max element : 50
*-*-*-*-*-*-*-*-*-*-*-*

enter the value :6
Not found ..
*-*-*-*-*-*-*-*-*-*-*-*

delete element 9:-
1 2 4 5 7 8 50
delete element 2 :-
1 4 5 7 8 50
delete element 8 :-
1 4 5 7 50

[Program finished]
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#Binary_Search_Algorithm

خـوارزمــية البــحث الـثــنائـي:-

#include <iostream>
using namespace std;

int BinarySearch(int array[], int Size, int SearchValue)
{
int low = 0;
int high = Size - 1;
int mid ;

while (low <= high)
{
mid = (low + high) / 2;

if (SearchValue == array[mid])
{
return mid;
}
else if (SearchValue > array[mid])
{
low = mid + 1;
}
else
{
high = mid - 1;
}
}
return -1;
}
int main()
{
int a[] ={11, 32, 43, 54, 65, 76, 87, 98};
int value;
cout << "enter an integer :" << endl;
cin >> value;

int result = BinarySearch(a, 8, value);

if (result >= 0)
{
cout << "the number " << a[result] << " was found at the element with index " << result << endl;
}
else
{
cout << "the number " << value << " was not found " << endl;
}
}


•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

enter an integer :
3
the number 3 was not found [Program finished]

-*-*-*-*-*-*-*-*-*-*-*-*-*

enter an integer :
98
the number 98 was found at the element with index 7
[Program finished]
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#insertion_sort
خوارزمية الترتيب بالإدراج

#include <iostream>
using namespace std;

void insertionSort(int a[], int Size)
{
int key, i, j;

for (i = 1; i < Size; i++)
{
key = a[i];
j = i;

while (j > 0 && a[j - 1] > key)
{
a[j] = a[j - 1];
j -= 1;
}

a[j] = key;
}
}

void printArray(int a[], int Size)
{
for (int i = 0; i < Size; i++)
{
cout << a[i] << " ";
}
cout << endl;
}

int main()
{
int a[11] = {9, 2, 5, 7, 1, 6, 3, 4, 8, 0, 10};
int Size = sizeof(a) / sizeof(a[0]);

cout << "Array befor sorted....\n";
printArray(a, Size);

insertionSort(a, Size);

cout << "Array after sorted....\n";
printArray(a, Size);

return 0;
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

Array befor sorted....
9 2 5 7 1 6 3 4 8 0 10
Array after sorted....
0 1 2 3 4 5 6 7 8 9 10
[Program finished]
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#selection_sort

خوارزمية الترتيب بالأختيار

#include <iostream>
using namespace std;

void selectionSort(int arr[], int Size)
{
int min, i, j, temp;

for (i = 0; i < Size; i++)
{
min = i;

for (j = i + 1; j < Size; j++)
{
if (arr[j] < arr[min])
min = j;
}

temp = arr[i];
arr[i] = arr[min];
arr[min] = temp;
}
}


void printArray(int arr[], int Size)
{
for (int i = 0; i < Size; i++)
{
cout << arr[i] << " ";
}

cout << endl;
}



int main()
{
int arr[10] = {2, 5, 4, 3, 8, 1, 9, 0, 7, 6};
int Size = sizeof(arr) / 4;

cout << "Array befor sorted....\n";
printArray(arr, Size);

selectionSort(arr, Size);

cout << "Array after sorted....\n";
printArray(arr, Size);

return 0;
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

Array befor sorted...
2 5 4 3 8 1 9 0 7 6 Array after sorted....
0 1 2 3 4 5 6 7 8 9 [Program finished]
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#Merge_Sort

خــوارزمية الـفرز بالــدمج :-

#include <iostream>
using namespace std;

void merge(int arr[], int start, int mid, int end)
{
int i, j, k;
int len1 = mid - start + 1;
int len2 = end - mid;
int *L, *R;
L = new int[len1];
R = new int[len2];

for (i = 0; i < len1; i++)
L[i] = arr[start + i];
for (j = 0; j < len2; j++)
R[j] = arr[mid + 1 + j];
i = j = 0;
k = start;

while (i < len1 && j < len2)
{
if (L[i] <= R[j])
{
arr[k] = L[i];
i++;
}
else
{
arr[k] = R[j];
j++;
}
k++;
}

while (i < len1)
{
arr[k] = L[i];
i++;
k++;
}

while (j < len2)
{
arr[k] = R[j];
j++;
k++;
}

} //end merge_function

void mergeSort(int arr[], int start, int end)
{
int mid;
if (start < end)
{
mid = (start + end) / 2;
mergeSort(arr, start, mid);
mergeSort(arr, mid + 1, end);
merge(arr, start, mid, end);
}
return;
} //end mergeSort_function

void print(int arr[], int Size)
{
for (int i = 0; i < Size; i++)
{
cout << arr[i] << " ";
}

cout << endl;
}

int main()
{
int arr[10] = {2, 5, 9, 1, 40, 0, 8, 1, 7, 25};
int Size = sizeof(arr) / 4;

cout << "array befor sorted...\n";
print(arr, Size);

mergeSort(arr, 0, Size - 1);

cout << "array after sorted...\n";
print(arr, Size);

return 0;

} //end main



•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

array befor sorted...
2 5 9 1 40 0 8 1 7 25
array after sorted...
0 1 1 2 5 7 8 9 25 40 [Program finished]
This media is not supported in your browser
VIEW IN TELEGRAM
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

#Quick_Sort

خــوارزمــية الفــرز الســريع :-

#include <iostream>
using namespace std;

int partition(int arr[], int low, int high)
{
int temp;
int pivot = arr[low];
int i = low + 1;

for (int j = low + 1; j <= high; j++)
{
if (arr[j] <= pivot)
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
i++;
}
}

temp = arr[low];
arr[low] = arr[i - 1];
arr[i - 1] = temp;
return (i - 1);
}

void quickSort(int arr[], int low, int high)
{
if (low < high)
{
int pivot = partition(arr, low, high);
quickSort(arr, low, pivot - 1);
quickSort(arr, pivot + 1, high);
}
}

void print(int arr[], int Size)
{
for (int i = 0; i < Size; i++)
{
cout << arr[i] << " ";
}

cout << endl;
}

int main()
{
int arr[10] = {2, 5, 9, 85, 40, 0, 8, 1, 7, 25};
int Size = sizeof(arr) / 4;

cout << "Array befor sorted....\n";
print(arr, Size);

quickSort(arr, 0, Size - 1);

cout << "Array after sorted....\n";
print(arr, Size);

return 0;
}


•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥

Array befor sorted....
2 5 9 85 40 0 8 1 7 25
Array after sorted....
0 1 2 5 7 8 9 25 40 85
[Program finished]
Forwarded from ❥͢ ❈↡< C# > برمجة (1 {*_^})
السلام عليكم
هل تعرف ما هي تقنية Entity Framwork في الـ #C ...؟
وهل سبق أن استخدمتها في أحد مشاريعك بلغة #C ...؟ هذا ما سنتحدث عنه بعد اسطتلاع أراءكم ..
Anonymous Poll
20%
Yes
80%
No
Forwarded from NaS Digital (❥ツ)
إ₰...👨🏻‍💻..👩🏻‍💻...₰❥

نداء الى الجامعيين

لا يستخدم قوقل للبحث عن بحوث الجامعة، وانما استخدم scholar.google.com
متخصص للبحوث وجميع الكورسات المدروسة في القاعات الجامعية . .🖤

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @language_barmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
C_من_البداية_الى_البرمجة_الكيانية.pdf
4.5 MB
إ₰...👨🏻‍💻..👩🏻‍💻...₰❥

📙 نقدم لكم كتابين في لغة ++C وتطبيقاتها العملي والنظري

📚 الكتاب الأول باللغة الإنجليزية والثاني باللغة العربية لمن يواجه صعوبة في اللغة الإنجليزية

🔸 واي شخص مبتدا في مجال البرمجة تعتبر هذه الكتب المسار الصحيح لتعلم البرمجة

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @barrmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
Forwarded from NaS Digital
إ₰...👨🏻‍💻..👩🏻‍💻...₰❥

موقع تحميل Visual studio Code

https://code.visualstudio.com/#

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
❥➺┊ @language_barmaja
•┈┈┈•❈••✦✾✦••❈•┈┈┈•
#تحذير:-
إذا وصلك بريد إلكتروني من أي شخص -حتى صديقك- فيه مرفق صيغته أحد التالي فاحذر تفتحه نهائياً:
EXE
JAR
BAT
PSC1
VB
VBS
MSI
CMD
REG
WSF

وهذه صيغ يجب عليك فحصها بمكافح فيروسات بعد تحميلها وقبل فتحها:
ZIP
RAR
7Z
DOCX
XLSX
PPTX
DOCM
XLSM
PPTM

ولا تفتح أي مرفق من مرسِل لا تعرفه.
2025/02/18 02:51:30
Back to Top
HTML Embed Code: