the1 - Middle East Technical University Department of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Middle East Technical University Department of Computer Engineering CENG 140 Fall 2010-2011 Take Home Exam 1 REGULATIONS Due date: 29 November, 2010 Monday (Not subject to postpone) Submission: Electronically. You will be submitting your program source code through a text file which you will name as the.c by means of the COW system. Team: There is no teaming up. The homework has to be done and turned in individually. Cheating: The source(s) and the receiver(s) will receive zero and be subject to disciplinary action. BACKTRACKING Backtracking is a widely-used method in Computer Science for finding a solution to a problem incrementally. The current (partial) solution is usually kept as an ordered set V = v 1 ,..,v N and at each step, a new partial- solution-element v i is added to V in such a way that the addition of v i to V approaches us one step closer to the complete solution and that v i is not in conflict with V as far as the problem is concerned. If V + v i is invalid, another element, if there is any, is placed in the position of v i . If no v can be found that would make V + v valid, the algorithm backtracks ; in other words, it goes back to the previous step and tries another element v ; in our scenario, this would mean removing v LAST and placing some other v in v LAST ’s place that would not invalidate V . The process of (i) adding a valid new partial solution, and (ii) backtracking to find a valid new partial solution is repeated until a solution is found or all the possible options are exhausted, which means that no valid solution exists for the problem. A good example of backtracking is the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/06/2011 for the course CENG ceng 230 taught by Professor Prof.osmanwxw during the Spring '10 term at Middle East Technical University.

Page1 / 4

the1 - Middle East Technical University Department of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online