Laboratory Work №2 Theme: Implementation of functions, parameters and data transfer Aim


Source code: To implement Queue ADT using an array



Download 263,25 Kb.
bet3/4
Sana01.01.2022
Hajmi263,25 Kb.
#293403
1   2   3   4
Bog'liq
DSA Lab2

Source code: To implement Queue ADT using an array







Task 1.

1.Write a program to perform matching of parenthesis using stack.

2.Write a program to perform evaluation of postfix expression

3.Write a program to convert given infix expression to post fix



Task 2: Define a new semi-static data structure (queue). Describe the standard operations for working with a semi-static data structure (adding a new element, extracting an element, printing the structure, deleting an element, determining the length, filling the structure).

1. Write a procedure for replacing the first and the last element of the queue

2. Write a procedure to remove an element that is in the middle of the queue if the number of elements is odd, and if it is even, the two middle elements.

3. Write a procedure to rearrange the maximum and minimum elements of the queue

4. Write a procedure for removing the maximal element of the queue

5. Write a procedure for deleting the minimal element of the queue

6. Find the minimum element of the queue and insert 0 after it.

7. Find the maximal element of the queue and insert 0 after it.

8. Write a procedure to remove all elements from the queue equal to the first.

9. Write a procedure to delete all elements from the queue, equal to the last one.

10. Insert element '0' in the middle of the queue if the number of elements is even, and after the middle element if it is odd.

11. Write a procedure for unrolling the queue, i.e. make the 'bottom' of the queue the vertex and the vertex the 'bottom'.

12. Write a procedure to delete the odd element of the queue.

13. Write a procedure for deleting even elements of the queue.

14. Write a procedure for deleting elements which are prime number

15. Write a procedure to delete elements that are roots




Download 263,25 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish