книги2 / Ilyin-Fundamentals-and-methodology-of-programming
.pdfis the first element of the chain, the end (last) is its last element. There is a number K and two queues. Move the K starting elements of the first queue to the end of the second queue. If the first queue contains less than K elements, then move all elements from the first queue to the second. Print the new addresses of the beginning and end of the first and then the second queue.
Option 6
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a set of 10 numbers. Create a queue containing the given numbers in the specified order (the first number will be placed at the beginning of the queue, the last at the end), and display pointers to the beginning and end of the queue.
Option 7
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues. Queues contain the same number of elements. Combine two queues into one, in which the elements of the original queues are interleaved (starting with the first element of the first queue). Print pointers to the beginning and end of the resulting queue.
Option 8
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues, pointers to the beginning and end of a queue containing at least 10 elements. Extract five initial elements from both queues and write them into a 2 by 5 matrix.
Option 9
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues. The elements of each queue are ordered in ascending order. Combine queues into one
190
while maintaining the order of elements. Print pointers to the beginning and end of the resulting queue.
Option 10
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a set of 10 numbers. Create two queues: the first should contain all odd numbers, and the second – all even numbers from the original set (the order of the numbers in each queue must match the order of the numbers in the original set). Print pointers to the beginning and end of the first and then the second queue (one of the queues may be empty; in this case, print two nil constants for it).
Option 11
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a number K and pointers to the beginning and end of the queue. Add an element with value K to the end of the queue and print the new addresses of the beginning and end of the queue.
Option 12
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a number K and pointers to the beginning and end of a queue containing at least two elements. Add an element with value K to the end of the queue and remove the first (starting) element from the queue. Print the value of the extracted element and the new addresses of the beginning and end of the queue.
Option 13
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a number K and pointers to the beginning and end of the queue. Extract K initial elements from the queue and display their values (if the queue contains less than K elements, then extract all its
191
elements). Also print the new addresses of the beginning and end of the queue (for an empty queue, print NULL twice ).
Option 14
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues. It is necessary to move elements from the beginning of the first queue to the end of the second until the value of the initial element of the first becomes even (if the first queue does not contain even elements, then move all elements from the first queue to the second). Print the new addresses of the beginning and end of the first and then the second queue.
Option 15
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are three queues. The elements of each queue are not ordered. Combine queues into one and sort its elements. Print pointers to the beginning, middle, and end of the resulting queue.
Option 16
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is a number K and three queues. Move K initial elements of the first queue to the end of the second and third queue. If the first queue contains less than K elements, then move all elements from the first queue to the second and third. Print the new start and end addresses of all queues.
Option 17
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There is an array of 5 numbers. Create a queue and write the elements of this array there in the specified order (the first number will be placed at the beginning of the queue, the last at the end) and display pointers to the beginning, middle and end of the queue.
192
Option 18
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues. Queues contain different numbers of elements. Combine two queues into one, in which the elements of the original queues alternate (starting from the first element of the first queue), placing the remaining elements at the end. Print pointers to the beginning and end of the resulting queue.
Option 19
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are three queues (5 elements each), pointers to the beginning and end of the queues. Extract five initial elements from the queues and write them into a 3 by 5 matrix.
Option 20
There is a queue structure (type TQueue), which is modeled by a chain of connected nodes (an element with a Data field and a Next pointer). The beginning of the queue (front) is the first element of the chain, the end (last) is its last element. There are two queues. The elements of each queue are ordered in descending order. Combine queues into one while maintaining the order of elements. Print pointers to the beginning, middle, and end of the resulting queue.
Practical work No. 15. Assignments for independent work on the topic “Binary trees”
Option 1
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Find, using the CLP tree traversal method (root-left-right), the number of elements with a given key.
193
Option 2
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Find, using the LKP (left-root-right) tree traversal method, the maximum element in the tree.
Option 3
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LKP (left-root-right) tree traversal method, find the number of leaves in the tree.
Option 4
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the RLP (root-left-right) tree traversal method, find the minimum element in the tree.
Option 5
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LKP (left-root-right) tree traversal method, find the height of the tree.
Option 6
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LKP (left-root-right) tree traversal method, find the arithmetic mean of the tree elements.
Option 7
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LPK (left-right-root) tree traversal method , find the number of tree elements starting with a given symbol.
Option 8
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the CLP (root-left-right) tree traversal method, find the number of elements with a given key.
194
Option 9
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LKP (left-root-right) tree traversal method, find the maximum element in the tree.
Option 10
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LRC (left-right-root) tree traversal method, find the number of leaves in the tree.
Option 11
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the RLP (root-left-right) tree traversal method, find the minimum element in the tree.
Option 12
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Information field type char. Using the LKP (left-root- right) tree traversal method, find the height of the tree.
Option 13
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Information field type int. Using the LPK (left-right-root) tree traversal method, find the arithmetic mean of the tree elements.
Option 14
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Information field type char. Using the CLP (root-left-right) tree traversal method, find the number of elements with a given key.
195
Option 15
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Information field type string. Using the LKP (left-root- right) tree traversal method, find the number of tree elements starting with a given symbol.
Option 16
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LRC (left-right-root) tree traversal method, find the maximum element in the tree.
Option 17
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the root-left-right tree traversal method, find the number of leaves in the tree.
Option 18
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LKP (left-root-right) tree traversal method, find the minimum element in the tree.
Option 19
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the LPK (left-right-root) tree traversal method , find the arithmetic mean of the tree elements.
Option 20
Describe a model of the structure of a binary tree. Implement functions for adding, deleting and printing elements. Using the CLP tree traversal method (root-left-right), find the number of elements with a given key
196
BIBLIOGRAPHY
1.Algorithms and programs. Language C ++ / E.A. Konova, G.A. Pollak. – St. Petersburg: Lan, 2017. – 384 p.
2.Algorithms: development and application. Classic Computers Science / J. Kleinberg, E. Tardos. – St. Petersburg: Peter, 2016. – 800 p.
3.Androsova E.G. Methodological and content aspects of constructing a programming course based on an object-oriented approach (for physics and mathematics specialties of pedagogical universities): dis. ...cand. ped. Sci. – M., 1996.
4.Bordyugova T.N. Methodological approaches to the formation of competencies in the field of programming based on the implementation of an individual learning path: dis. ...cand. Ped.Sc. – M., 2011. – 141 p.
5.C ++ programming language [Electronic resource] / Stanley Lippman, Josi Lajoye. – Saratov: Vocational Education, 2017. – 1104 p. // EBS IPRbooks – URL : http://www.iprbook shop.ru/63964.html (access date: 09/01/2017).
6.C programming . – M.: Eksmo, 2013. – 624 p.
7.C++ programming language. Basic Course / Stanley B. Lippman, Josie Lajoie, Barbara E. Mu. – M.: Williams, 2017. – 1397 p.
8.Clemens B. Language C in the 21st century. – M.: DMK Press, 2015. – 376 p.
9.Computer science (basic level): 2 hours, grades 10–11. Part 2: textbook. / ed. N.V. Makarova. – M.: BINOM. Knowledge Laboratory, 2019. – 368 p.
10.Computer science. 10–11 grades. Basic level: textbook: in 2 hours. Part 1 / ed. prof. N.V. Makarova. – M.: BINOM. Knowledge Laboratory, 2016. – 384 p.
11.Computer science. 10th grade: textbook. / L.L. Bosova, A.Yu. Bosova. – M.: BINOM. Knowledge Laboratory, 2016. – 288 p.
12.Computer science. Advanced level: textbook. for 10th grade / I.A. Kalinin, N.N. Samylkina. – M.: BINOM. Knowledge Laboratory, 2013.
13.Computer science. Advanced level: textbook. for 11th grade / I.A. Kalinin, N.N. Samylkina. – M.: BINOM. Knowledge Laboratory, 2013.
14.Computer science. Advanced level: textbook. for grade 10: at 2 hours. Part 1 / K.Yu. Polyakov, E.A. Eremin. – M.: BINOM. Knowledge Laboratory, 2013. – 344 p.
15.Computer science. Advanced level: textbook. for grade 10: at 2 hours. Part 2 / K.Yu. Polyakov, E.A. Eremin. – M.: BINOM. Knowledge Laboratory, 2013. – 304 p.
16.Computer science. Advanced level: textbook. for grade 11: at 2 hours. Part 1 / K.Yu. Polyakov, E.A. Eremin. – M.: BINOM. Knowledge Laboratory, 2013. – 240 p.
197
17.Computer science. Advanced level: textbook. for grade 11: at 2 hours. Part 2 / K.Yu. Polyakov, E.A. Eremin. – M.: BINOM. Knowledge Laboratory, 2013. – 304 p.
18.Computer science. Grade 11. Basic level: textbook. / L.L. Bosova, A.Yu. Bosova. – M.: BINOM. Knowledge Laboratory, 2016. – 256 p.
19.Davis S. C++ for dummies. – M.: William c , 2003. – 336 p.
20.Demonstration version of control measurement materials of the Unified State Exam (USE) 2019 in computer science and ICT [Electronic resource] / Federal. institute of ped. measurements. – URL: http://fipi.ru/ege-i-gve-11/demoversii-specifikacii-kodi- fikatory
21.Demonstration version of control measuring materials for conducting the main state exam (OGE) in computer science and ICT in 2019 [Electronic resource] / Feder. institute of ped. measurements. – URL: http://fipi.ru/oge-i-gve-9/demoversii-specifikacii- kodifikatory
22.Federal state educational standard of secondary (complete) general education
(dated May 17 2012 г, No. 413). – 45 s.
23.Flenov M.E. Programming in C ++ through the eyes of a hacker. – St. Petersburg: BHV-Petersburg, 2009. – 352 p.
24.Informatics and ICT: textbook. for 10th grade general education institutions: basic and profile. levels / A.G. Gein, A.B. Livchak, A.I. Senokosov and others – 2nd ed.
–M.: Education, 2012. – 272 p.
25.Ivanov V.B. Application programming in C / C ++. From scratch to multimedia and network applications [Electronic resource]. – M.: SOLON-PRESS, 2008. – 240 p. // EBS IPRbooks. – URL : http://www.iprbookshop.ru/8727 (access date: 09/01/2017).
26.Kaufman V.Sh. Programming languages. Concepts and principles [Electronic resource]. – Saratov: Vocational Education, 2017. – 464 p. // EBS IPRbooks. – URL : http://www.iprbook shop.ru/64055.html (access date: 09/01/2017).
27.Kirillov A. G. Formation of professional competencies of a future computer science teacher in the process of teaching programming: abstract. dis. ...cand. ped. Sci. – Ekaterinburg, 2005. – 22 p.
28.Kolpien J. Programming in C ++. Classic CS . – St. Petersburg: Peter, 2005. –
479 p.
29.Koltsov D.M. 100 examples in C. – St. Petersburg: Science and Technology, 2017. – 256 p.
198
30. Kostyukova N.I. Programming in C language [Electronic resource]. – Novosibirsk: Sibir. university. publishing house, 2017. – 160 p. // EBS IPRbooks. – URL : http://www.iprbook shop.ru/65289.html (access date: 09/01/2017). –
31. Kugel L.A. Teaching students algorithmization and programming based on a structural-algorithmic approach to the formulation and implementation of problems: using the example of the direction of bachelor's training "Applied Informatics": abstract of thesis. dis. ...cand. ped. Sci. – M., 2015. – 22 p.
32.Laforet R. Object-oriented programming in C ++. – St. Petersburg: Peter, 2004.
–922 p.
33.Meshcheryakova N.A. Formation of information competence of students of economic specialties of universities when teaching object-oriented programming: abstract of thesis. dis. ...cand. ped. Sci. – Omsk, 2005. – 22 p.
34.Pavlovskaya T.A. C/C++. Programming in a high level language. – St. Petersburg: Peter, 2010. – 461 p.
35.Perry Gr. C Programming for Beginners. – M.: Eksmo, 2015. – 368 p.
36.Prata St. C programming language . Lectures and exercises. – M.: Williams, 2015. – 928 p.
37.Prata St. C++ programming language. Lectures and exercises. – M.: Williams, 2012. – 1248 p.
38.Programming language C / B. Kernighan, D. Ritchie. – M.: Williams, 2009. –
304 p.
39.Rao S. Master C ++ on your own in 21 days. – M.: Williams, 2013. – 651 p.
40.Retabouil S. Android NDK. Android application development using C / C. – M.: DMK Press, 2012. – 496 p.
41.Shildt G. C++: basic course. – M.: Williams, 2010. – 624 p.
42.Sofronova N.V. Theory and methodology of teaching computer science. – M.: Higher. school, 2003. – 186 p.
43.Spirin I.S. Electronic training course as a means of activating educational and cognitive activity when teaching programming to future computer science teachers: dis.
...cand. ped. Sci. – Shadrinsk, 2004. – 179 p.
44.Standard for Programming Language C++. ISO/IEC . – 2017. – No. 4687 . – 1647 rub .
45.Stolyarov A.V. Introduction to the C language. – M.: MAKS Press, 2018. – 136 p.
199