Exercices - Programmation
86 documents à télécharger gratuitement
Exercices de programmation, partagés par des étudiants et des enseignants. Thèmes couverts : algorithmique, langage C, Java, Python, POO, structures de données.
This document outlines a series of exercises focusing on manipulating linked lists in various contexts. It covers singly and doubly linked lists, algorithms for insertion, deletion, sorting, and searching, as well as domain-specific applications like polynomial representation, client management, and voting. The exercises aim to develop a comprehensive understanding of data structures through practical implementations and real-world scenarios.
This document presents a series of exercises focused on linked data structures like singly and doubly linked lists, ranging from list creation, insertion, and traversal to specific applications like polynomials, customer management, election results, and student ranking based on averages. Each exercise builds on fundamental algorithms to process, sort, and represent data efficiently. It emphasizes user-defined inputs and outputs, flexible manipulations of structures, and application-specific solutions in real-world scenarios. Advanced tasks introduce ranking and scoring mechanisms for aggre...
This document systematically introduces linked lists, exploring both singly and doubly linked structures. Ten exercises progressively guide students through fundamental operations, including insertion, deletion, search, and custom manipulations, applied to various contexts like polynomial representation, voting systems, and student record management. More advanced challenges include managing client data for automated selection and calculating rankings based on grades in a dynamic student database. These tasks integrate theoretical explanations and algorithmic implementations, promoting prac...
The document is a comprehensive guide to assembly language programming, including segment declaration for data, stack, and code, as well as the use and manipulation of variables, arrays, and procedures. It outlines initialization techniques for data and stack segments, introduces pseudo-instructions such as DB, DW, and DD, and explains the organization of code with examples of procedures and interrupt service routines. Moreover, it provides practical exercises for memory management, displaying messages, interacting with the keyboard, and manipulating and processing arrays, along with explan...
This document introduces the concept of recursion in programming, contrasting it with iterative approaches. It explains direct and mutual recursion with detailed examples, including factorial computation through iterative and recursive methods. Principles for writing recursive functions, such as incorporating base cases, are emphasized to avoid infinite recursion. Additionally, the document provides multiple exercises for practicing recursive and iterative techniques in C programming, highlighting their applications.
This document explores the concept of recursion in programming, describing how recursive functions can replace iterative loops to solve problems more elegantly. It provides examples of recursive and iterative implementations for factorial calculations, discussing the essential components of recursion such as base cases and general cases, as well as potential pitfalls when developing recursive algorithms. The document concludes with practical exercises for implementing recursion, such as calculating sums, powers, and applying recursion to specific algorithmic problems like quicksort.
This document introduces the concept of recursion in programming, explaining its mechanics and differences compared to iterative programming techniques. It demonstrates the recursive and iterative implementations of classic problems, such as calculating factorials, summing integers, and computing powers. Key aspects of recursive functions, including base cases and general cases, are outlined to prevent potential inefficiencies or infinite recursion. Additional examples highlight both correct and flawed recursive approaches, emphasizing common pitfalls and best practices.
This document is an exam-like exercise series designed to test foundational knowledge in pointers for first-year computer science students. The exercises involve filling tables based on pointer arithmetic operations and memory address manipulations, writing C programs to perform array manipulations using pointers, and solving pointer-related problems. The methodology focuses on practical application of pointer concepts with step-by-step implementations. Students are challenged to predict outcomes in pointer behavior and program execution within the C programming language.
This document provides a series of practical exercises on programming with pointers, targeted towards first-year computer science students. The exercises encompass analyzing and modifying pointer operations within C programs, calculating pointer arithmetic, and creating programs to manipulate arrays using pointers. Key methodologies include tracing pointer behavior step-by-step, implementing array operations, and debugging. Essential findings include insights into the behavior of memory addressing, pointer arithmetic, and various pointer-based algorithms for array manipulation.
This document presents a series of programming exercises designed for first-year computer science students to practice and learn structured programming in C. The exercises involve tasks such as converting 'for' loops to 'while' loops, solving second-degree equations, building arithmetic tables, converting character cases, binary transformations, text manipulation, and data compression using encoding. Each problem challenges students to implement algorithms that enhance their logical reasoning and programming skills.
This document provides a collection of programming exercises for C language learners, targeting specific logical structures such as loops and conditionals. The exercises include implementing mathematical equation solvers, character manipulation, text transformations, and data compression algorithms. A significant portion of these exercises challenges students to translate 'for' loops into 'while' loops and handle user input effectively. The document concludes with practical string and mathematical operations that help reinforce critical programming skills.
The document outlines programming exercises focused on binary file handling in C as part of an advanced programming workshop. Exercise 1 involves implementing a system to create, read, display, and modify a binary file containing student records. Exercise 2 focuses on managing dynamic records with varying numbers of grades and simultaneously maintaining an index file to track record sizes. Both exercises emphasize the use of structs and dynamic memory allocation, requiring functions for file population, data retrieval, and record manipulation.
This document provides detailed examples of five C programming exercises focused on string manipulation. It covers palindromes using both array and pointer formalism, string reversal, counting specific characters, replacing substrings with equal or different lengths, and removing specific characters from a string. The explanations include both code snippets and expected outputs, demonstrating practical applications. A step-by-step approach is provided for beginner-level students to grasp fundamental C programming skills.
This document is a practical guide on C programming, focusing on string manipulation. It provides detailed examples and solutions to common programming tasks, such as palindrome verification, counting occurrences of a character, reversing strings, and modifying content with substitution in various scenarios. With each exercise, the document demonstrates algorithm implementation using both array and pointer formalism and includes complete, runnable code to enhance the learner's understanding.












