Forwarded from Python daturlash maktabi π
Media is too big
VIEW IN TELEGRAM
1. Python Boshlang'ich - Tanishuv
@uz_python
Buni albatta kΓ²rib chiqing va albatta siz eng zΓ΅r dasturlash tilini Γ΅rganishni boshlang !!!
@uz_python
Buni albatta kΓ²rib chiqing va albatta siz eng zΓ΅r dasturlash tilini Γ΅rganishni boshlang !!!
Qaysi dasturlash tilidan video kurs tashlaylik!!!
Anonymous Poll
53%
Python
21%
C++ (Malumotlar tuzilmasi)
14%
Java
13%
Xammasidan
This media is not supported in your browser
VIEW IN TELEGRAM
Ma'lumot tuzilmalari (Data Structures) - Kirish
πππππππππππ
@uz_python
πππππππππππ
@uz_python
#Stekning juft oβrinda turgan elementlari oβchirilsin.
stack=[]
n=int(input("stack nechta elemntdan iborat: "))
for i in range (0, n):
a=input("stack elemntlarini kiriting: ")
stack.append(a)
j=0
for i in stack:
if j:
stack.pop(j)
j+=1
print(stack)
stack=[]
n=int(input("stack nechta elemntdan iborat: "))
for i in range (0, n):
a=input("stack elemntlarini kiriting: ")
stack.append(a)
j=0
for i in stack:
if j:
stack.pop(j)
j+=1
print(stack)
Media is too big
VIEW IN TELEGRAM
Ma'lumot tuzilmalari (Data Structures) - Bog'langan ro'yhat (Linked List)
ππππππ
@uz_python
ππππππ
@uz_python
Malumotlar Tuzilmasidan siz uchun kerakli bo'lgan videokurslar
@uz_python π―π―π―
Ma'lumot tuzilmalari (Data Structures) - Kirish
https://t.me/uz_python/191
Ma'lumot tuzilmalari (Data Structures) - List va Array haqida
https://t.me/uz_python/193
Ma'lumot tuzilmalari (Data Structures) - Bog'langan ro'yhat (Linked List)
https://t.me/uz_python/194
Ma'lumot tuzilmalari (Data Structures) - Stack
https://t.me/uz_python/195
Ma'lumot tuzilmalari (Data Structures) - Queue
https://t.me/uz_python/196
Ma'lumot tuzilmalari (Data Structures) - Tree
https://t.me/uz_python/197
Ma'lumot tuzilmalari (Data Structures) - Binary Tree
https://t.me/uz_python/198
@BekorchiStudentlar
@uz_python π―π―π―
Ma'lumot tuzilmalari (Data Structures) - Kirish
https://t.me/uz_python/191
Ma'lumot tuzilmalari (Data Structures) - List va Array haqida
https://t.me/uz_python/193
Ma'lumot tuzilmalari (Data Structures) - Bog'langan ro'yhat (Linked List)
https://t.me/uz_python/194
Ma'lumot tuzilmalari (Data Structures) - Stack
https://t.me/uz_python/195
Ma'lumot tuzilmalari (Data Structures) - Queue
https://t.me/uz_python/196
Ma'lumot tuzilmalari (Data Structures) - Tree
https://t.me/uz_python/197
Ma'lumot tuzilmalari (Data Structures) - Binary Tree
https://t.me/uz_python/198
@BekorchiStudentlar
Bitta dasturiy maxsulot davlatimizga qancha naf keltiradi, korrupsiya, byurokratiyani bartaraf etadi, Odamlarga qulaylik yaratadi.
Xar doyim yodda tutingki sizlarni ishingiz judayam muxim.
Credid: #ustoz_shogird
@uz_python
Xar doyim yodda tutingki sizlarni ishingiz judayam muxim.
Credid: #ustoz_shogird
@uz_python
2 ta roβyhatning bir xil qiymatli elementlaridan yangi halqasimon roβyhat yarating
#include <iostream>
using namespace std;
class Node{
public: int number;
Node* next;
};
int main()
{ Node* head = NULL;
Node* lastPtr = NULL;
short action = -1;
while (1)
{ cout<<"1. 1- guruh raqam berish\n";
cout<<"2 2-guruh raqam berish:\n";
cout<<"3. ro'yhatni ko'rish\n";
cout<<"4 ro'yxatni korish\n";
cout<<" qushish\n";
cout<<"0. chiqish\n";
cout<<"tanlang: ";
cin>>action;
if (action == 0) {
system("CLS");
break;}
if (action == 1)
{ //system("CLS");
Node* ptr = new Node;
int numb = -1;
cout<<"son kiriting: ";
cin>>numb;
ptr->number = numb;
ptr->next = NULL;
if (head == 0)
{ head = ptr;
lastPtr = ptr;
// system("CLS");
continue;
}
lastPtr->next = ptr;
lastPtr = ptr;
//system("CLS");
continue;
}
if (action == 3){
Node* ptr = NULL;
//system("CLS");
if (head == 0)
{ cout<<"\t!!! ro'yhat bo'sh !!!\n\n";
system("PAUSE");
system("CLS");
continue;
}
cout<<"* * * * * ro'yhat * * * * *\n\n";
ptr = head;
while (1) {
cout<<ptr->number<<" ";
if (ptr->next == 0) break;
ptr = ptr->next;
}
cout<<"\n\n";
system("PAUSE");
//system("CLS");
continue;
}
if (action == 2)
{ //system("CLS");
Node* ken = new Node;
int numb = -1;
cout<<"son kiriting: ";
cin>>numb;
ken->number = numb;
ken->next = NULL;
if (head == 0)
{ head = ken;
lastPtr = ken;
// system("CLS");
continue;
}
lastPtr->next = ken;
lastPtr = ken;
system("CLS");
continue;
}
if (action == 4){
Node* ken = NULL;
//system("CLS");
if (head == 0)
{ cout<<"\t!!! ro'yhat bo'sh !!!\n\n";
system("PAUSE");
system("CLS");
continue;
}
cout<<"* * * * * ro'yhat * * * * *\n\n";
ken = head;
while (1) {
cout<<ken->number<<" ";
if (ken->next == 0) break;
ken = ken->next;
}
cout<<"\n\n";
system("PAUSE");
//system("CLS");
continue;
}
if(action==5)
{
Node* qush = NULL;
system("CLS");
#include <iostream>
using namespace std;
class Node{
public: int number;
Node* next;
};
int main()
{ Node* head = NULL;
Node* lastPtr = NULL;
short action = -1;
while (1)
{ cout<<"1. 1- guruh raqam berish\n";
cout<<"2 2-guruh raqam berish:\n";
cout<<"3. ro'yhatni ko'rish\n";
cout<<"4 ro'yxatni korish\n";
cout<<" qushish\n";
cout<<"0. chiqish\n";
cout<<"tanlang: ";
cin>>action;
if (action == 0) {
system("CLS");
break;}
if (action == 1)
{ //system("CLS");
Node* ptr = new Node;
int numb = -1;
cout<<"son kiriting: ";
cin>>numb;
ptr->number = numb;
ptr->next = NULL;
if (head == 0)
{ head = ptr;
lastPtr = ptr;
// system("CLS");
continue;
}
lastPtr->next = ptr;
lastPtr = ptr;
//system("CLS");
continue;
}
if (action == 3){
Node* ptr = NULL;
//system("CLS");
if (head == 0)
{ cout<<"\t!!! ro'yhat bo'sh !!!\n\n";
system("PAUSE");
system("CLS");
continue;
}
cout<<"* * * * * ro'yhat * * * * *\n\n";
ptr = head;
while (1) {
cout<<ptr->number<<" ";
if (ptr->next == 0) break;
ptr = ptr->next;
}
cout<<"\n\n";
system("PAUSE");
//system("CLS");
continue;
}
if (action == 2)
{ //system("CLS");
Node* ken = new Node;
int numb = -1;
cout<<"son kiriting: ";
cin>>numb;
ken->number = numb;
ken->next = NULL;
if (head == 0)
{ head = ken;
lastPtr = ken;
// system("CLS");
continue;
}
lastPtr->next = ken;
lastPtr = ken;
system("CLS");
continue;
}
if (action == 4){
Node* ken = NULL;
//system("CLS");
if (head == 0)
{ cout<<"\t!!! ro'yhat bo'sh !!!\n\n";
system("PAUSE");
system("CLS");
continue;
}
cout<<"* * * * * ro'yhat * * * * *\n\n";
ken = head;
while (1) {
cout<<ken->number<<" ";
if (ken->next == 0) break;
ken = ken->next;
}
cout<<"\n\n";
system("PAUSE");
//system("CLS");
continue;
}
if(action==5)
{
Node* qush = NULL;
system("CLS");
if (head == 0)
{ cout<<"\t!!! ro'yhatlar bo'sh !!!\n\n";
continue;
}
ken = head;
while (1) {
cout<<ken->number<<" ";
if (ken->next == 0) break;
if(ken ==prt)
{
Node* qush = new Node;
int numb = -1;
qush->number = numb;
qush->next = NULL;
if (head == 0)
{ head = qush;
lastPtr = qush;
continue;
}
lastPtr->next = qush;
lastPtr = qush;
continue;
}
}
cout<<"\n";
continue;
}
}
}
{ cout<<"\t!!! ro'yhatlar bo'sh !!!\n\n";
continue;
}
ken = head;
while (1) {
cout<<ken->number<<" ";
if (ken->next == 0) break;
if(ken ==prt)
{
Node* qush = new Node;
int numb = -1;
qush->number = numb;
qush->next = NULL;
if (head == 0)
{ head = qush;
lastPtr = qush;
continue;
}
lastPtr->next = qush;
lastPtr = qush;
continue;
}
}
cout<<"\n";
continue;
}
}
}
Ro'yhat Kiritilgan sonlarningn har 3chisini o`chiruvchi dastur tuzing.
Dastur kodi:
#include <bits/stdc++.h>
using namespace std;
int main() {
list <int> num_list;
int n,k;
cout<<"Nechta son kiritasiz: ";
cin>>n;
for(int i=0;i<n;i++)
{ cin>>k;num_list.push_back(k); }
size_t size = num_list.size();
cout<<"natija: ";
list <int> :: iterator it = num_list.begin();
while(size--)
{ auto toDelete = it; it++;
if (size%3==1) num_list.erase(toDelete); }
for(it = num_list.begin();
it != num_list.end(); ++it)
{ cout << *it << " "; }
cout << endl; return 0; }
Dastur natijasi:
Nechta son kiritasiz: 10
1 2 3 4 5 6 7 8 9 10
natija: 1 2 4 5 7 8 10
Dastur kodi:
#include <bits/stdc++.h>
using namespace std;
int main() {
list <int> num_list;
int n,k;
cout<<"Nechta son kiritasiz: ";
cin>>n;
for(int i=0;i<n;i++)
{ cin>>k;num_list.push_back(k); }
size_t size = num_list.size();
cout<<"natija: ";
list <int> :: iterator it = num_list.begin();
while(size--)
{ auto toDelete = it; it++;
if (size%3==1) num_list.erase(toDelete); }
for(it = num_list.begin();
it != num_list.end(); ++it)
{ cout << *it << " "; }
cout << endl; return 0; }
Dastur natijasi:
Nechta son kiritasiz: 10
1 2 3 4 5 6 7 8 9 10
natija: 1 2 4 5 7 8 10
/* 2ta nxn matitsani ko'paytirish */
#include<iostream>
#include<vector>
using namespace std;
int a[10][10],b[10][10],H[10][10];
int main(){
int n; cout<<"n: "; cin>>n;
cout<<"a["<<n<<"]["<<n<<"] : \n";
for (int i = 0; i < n; i++){
for (int j = 0; j< n; j++){
cin>>a[i][j];
}}
cout<<"b["<<n<<"]["<<n<<"] : \n";
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cin>>b[i][j];
}}
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
// H[i][j] = 0;
for (int t = 0; t < n; t++){
H[i][j] += a[i][t] * b[t][j];
}
}
}
cout<<"a["<<n<<"]["<<n<<"]xb["<<n<<"]["<<n<<"] :\n";
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cout<< H[i][j]<<" " ;
}cout<<endl;
}
}
#include<iostream>
#include<vector>
using namespace std;
int a[10][10],b[10][10],H[10][10];
int main(){
int n; cout<<"n: "; cin>>n;
cout<<"a["<<n<<"]["<<n<<"] : \n";
for (int i = 0; i < n; i++){
for (int j = 0; j< n; j++){
cin>>a[i][j];
}}
cout<<"b["<<n<<"]["<<n<<"] : \n";
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cin>>b[i][j];
}}
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
// H[i][j] = 0;
for (int t = 0; t < n; t++){
H[i][j] += a[i][t] * b[t][j];
}
}
}
cout<<"a["<<n<<"]["<<n<<"]xb["<<n<<"]["<<n<<"] :\n";
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cout<< H[i][j]<<" " ;
}cout<<endl;
}
}