vineeths96 / Polynomial-Arithmetic

In this repository, we perform the division of polynomials represented in memory with doubly linked lists.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Language Contributors Forks Stargazers Issues MIT License LinkedIn


Polynomial Arithmetic

Division of two polynomials
Explore the repository»

View Problem Statement

tags : polynomial arithmetic, linked list, doubly linked list

About The Project

This program performs the division of polynomials represented in memory with doubly linked lists. The entire program is written in three files - client.c, header.c, and implement.c. Comments have been added frequently to help in understanding the logic behind implementation. The two polynomials have to inputted as (power, coefficient) pairs. This program performs the division of the first polynomial by the second and outputs the quotient and remainder in (power, coefficient) pairs. This program repeats indefinitely till exited manually. Refer Problem statement file for detailed information.

The function when executed expects the user to input two polynomials on which division has to be operated. The degree of polynomials has to be inputted first, which should be following by the (power, coefficient) value pairs. No coefficient of polynomial should be zero and the value pairs should be inputted in decreasing order of powers. Failing to adhere to these conditions would result in termination of the program. After both polynomials are inputted the division() performs the division and stores the quotient and remainder in two lists. They are printed on screen as (power, coefficient) pairs and then the lists are deleted to free up used space.

Built With

This project was built with

  • C
  • Ubuntu 18.04.1
  • gcc version 7.4.0

Getting Started

Clone the repository into a local machine using

git clone https://github.com/vineeths96/Polynomial-arithmetic

Instructions to run

Open the terminal, make the program and run it.

make
./a.out

Enter the values from the file (or custom values) as requested during execution of the program.

Testcases

The testcase.txt contains the 5 test cases. Comments have been added to guide through the test case file to identify where to input data.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Vineeth S - vs96codes@gmail.com

Project Link: https://github.com/vineeths96/Polynomial-arithmetic

About

In this repository, we perform the division of polynomials represented in memory with doubly linked lists.

License:MIT License


Languages

Language:C 81.1%Language:C++ 15.7%Language:Makefile 3.2%