Introduction to Algorithms No.3

Hello. I would have completed Chapter 2. But I have not. It takes a lot of time to think about and write algorithms. These are what I have finished writing today:

https://github.com/uriha421/introduction_to_algorithms/blob/master/I_Foundations/searching_problem.c

https://github.com/uriha421/introduction_to_algorithms/blob/master/I_Foundations/add_two_n-bit_integers.c

The first program is about a searching problem. It receives an array and a number that the array has, as an input. Like (5, 3, 4, 2, 1), 4. Then it returns where the number is, as an output, 3.

The second program is about adding two n-bit integers. It receives two n-bit integers as an input. Like (11010), (11100). Then it returns the sum of those integers as an output. Like (110110).


In addition, I have learnt "loop invariant." I would like to tell you here. But it is difficult to explain. I will show you it some other time :(

Thank you.

Comments

  1. Got it. The second program is interesting. It’s a good idea. ^_^

    ReplyDelete

Post a Comment

Popular posts from this blog

Introduction to Algorithms No.7

Introduction to Algorithms No.10