Skip to content

Programming assignments for the course Fine Techniques using C, SEM-4

License

Notifications You must be signed in to change notification settings

pvn-a/FineTech2k20

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FineTech2k20

Programming assignments for the course Fine Techniques using C language.

Developmental Env

Code developed, debugged and tested on UBUNTU 18.04

Execution

make  
./a.out

3_Jug_Problem

Find out all the solutions to A-B-C jug problem.  
You are given 3 jugs of capacities A litres, B litres, and C litres.  
The initial state/initial volumes of water in the jugs is X, Y, and Z.  
Your goal is to get to a final state of P, Q, R litres.  
There are no markings on the jugs (you can’t just measure off litres directly).  
You may pour from a jug to any other jug (you have to transfer from one jug to another until either one jug becomes empty or the other full) . You cannot waste water. The total amount of water in the entire system must be the same as initial.

BST_HardDisk

Implement a binary search tree on a harddisk.  
Your tree should support the following operations (mentioned in the header file)
insert  
delete based on the key  
traversal - inorder : space separated values followed by \n  
traversal - pre-order : space separated values followed by \n  

My_Malloc

Fix the flaw in malloc, by implementing your own malloc with best-fit allocation policy.

Second_Max

Implement Stepanov's Binary counter to find the second biggest in an array of integers.  
The number of elements may be an exact power of 2 or may not be.  
The algorithm should have at most n + logn - 2 comparisons.(However when n is odd the number of comparisons can be little more)  
It may use extra space proportional to (logn) ^ 2.