rajibbd
Jul 31 2007, 07:25 PM
Dynamic Programming[DP] is one of the powerful programming approach now a day. DP applicable when sub problems share sub sub problems. (No independent sub problems). Solve each sub problem once, save the answer, and when needed use the previously computed result. Like for Fibonacci series. To get f(n+1) we need addition of f(n), f(n-1) and for f(n) we need f(n-1), f(n-2). so to get f(n+1) we need f(n) and f(n-1) and again for f(n) we need f(n-1) and f(n-2). In this approach we are calculating same thing more then once[as we need sub problem and for sub problem we need sub sub problem]. That is a very bad idea. But what if we store the data of f(n), f(n-1), f(n-1),..f(2), f(1), f(0) and reuse it while needed. That is one of the DP approach. DP is typically applied to optimization problem. Many solutions but DP find the one with minimum/maximum value. DP finds an optimal solution, rather the optimal solution. Four steps of DP- Characterize the structure of the optimal solution.
- Recursively define the value of the optimal solution.
- Compute the value of the optimal solution in a bottom-up fashion.
- Construct the optimal solution from computer result.
Reply
osknockout
Aug 3 2007, 03:47 AM
QUOTE DP finds an optimal solution, rather the optimal solution. Alright. What on earth are you trying to say? Anyway, isn't it common programming practice to do what you're suggesting anyway? I mean really, who actually spends time looping through a function recursively until he gets an answer instead of simply writing some code to go from (n-1) to n? Oh, and there's a name for your little technique. It's called lookup tables. Look it up.
Reply
rajibbd
Aug 3 2007, 08:56 AM
[cont] A problem may have many solution but we are trying to find out an optimal solution. I believe to learn a better programing language need to learn bettere technique. Dynamic Programing is use for optimize the solution. Each problem have many solution with various valus but we are trying to find out the optimal solution by using this DP approach. There are many problem who is solved under this approach. But obviously not every problem. Now you may woundering where we should apply those two method. If the problem is "Optimal Substure" and overlapping subproblems. Only then this dynamic programming can be applicable. If you need to know much about it then you better read book.
Reply
laexter
Nov 4 2007, 04:45 PM
QUOTE Oh, and there's a name for your little technique. It's called lookup tables. Look it up. Actually lookup tables officially has the name "memoisation", which is one form of dynamic programming (the top-down approach). The bottom up approach is sometimes faster and sometimes slower (in bottom-up approach, you generate all the answers to all subproblems then use that for answering the real thing). Dynamic programming will be very useful in very specific problems, namely when they have overlapping subproblems (like said). IMHO if you are interested in algorithms then proficiency in dynamic programming (and whether you know about it) is one of the "benchmark" of your programming skill.
Reply
Similar Topics
Keywords : discussion, dynamic, programming
- Finding The Rgb Color Of An Image
Using any programming language (3)
Why Must We Learn Object Oriented Programming
help me to understand the benefit of OOP (4) As a software laboratory assistant, I teach the class of Object Oriented Programming. Everything
went well until one day a student of mine ask me a simple problem like this Q/A: him : Why must we
use Object oriented Programming? I thought the usual one could do almost everything. me : Well, in
Object Oriented Programming we could make a class, so basically eveything could be made to an
'object' in our mind. him : That's why I'm asking, why must we made everything an
object? What's the difference? me : In Object Oriented Programming, Encapsulation ....
Alright, I'm Taking Computer Programming As A Class In School.
(10) Is there anything I should personally be worried about or anything I really need to know? I'm
pretty much good with computers and such and pretty much spend my whole life on them, lol.....
C++ General Discussion
any problem in c++ shall be discused here (8) hello guys i have started this topic to share our little experience with this language and could
help the needys out there and also to share programs or projects ... take care Please do not start
an empty topic--no actual discussing subject matter. We have dedicated C++ programming language
section. Moved. ....
C Programming Video Tutorials
This is for all the memebers out there looking or need some mroe help (3) Hello per this is for the memeber that want to start programming in " C "... C is a
very powerful Programming Lang In fact mayb to powerful.. Well there is 138 Videos in the
TUT.. I Have uploaded the it so per .rar is per chapter /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> P@ssword for ALL .rar files
is : sid3arm chapter #1 = Introduction to C ** Download link ** chapter #2 = A
basic C program ** Download link ** chapter #3 = Basic Elements of a C Program **
Download link ....
C Or C++ Easy Programming Generator
You need a program? (6) Hi i just had a stupid question on how to program is C or C++. I would like to know if there is any
program like Photoshop to create C codes or how to put them together. If someone could show me it
would be great. I appreciate it as i love computers and want to be like a wiz at it and also
everything related to it. I know that this is crazy and i have heard that from people they tell me
you're a GFX person stay there but i want to explore. Thanks if helped.....
How Many of You Use the C Programming language?
(23) Just wanted to know how many of you are currently using C language for programming. If you can tell
what sort of programs you do, it would be useful. ....
C Programming: Arrays
A Clear Description of Arrays (2) C programming provides a capability that enables a user to design a set of similar data types,
called Arrays. For understanding the arrays properly, let us consider the following program CODE
main() { int x; j=5 j=10; printf("\nj= %d",x); } No doubt, this
program will print the value of j as 10. This is because when a value 10 is assigned to j, the
earlier value of j, i.e. 5, is lost. Thus, ordinary variables are capable of holding only one value
at a time. However, there are situations in which we would want to store more than one....
Beginners Guide To C/c++ Programming?
(3) ok so I was wondering if anyone knows where I can find a good, c/c++ dummy friendly guide? my main
reason for want to learn it so that I can make .cab files that do registry edits for ppc. I know
this should be easy to do, Any help would be greatly appreciated. Thx in advanced, Mike....
C/c++ Programming Experince
How long does it take before programming useful programs? (3) I've been teaching my self C++, slowly but surely. Everything I try to program is just mediocre,
and much simplier to use something already made. How long does it take before I can start
programming useful decent programs?....
Detailed C Beginner Tut
basis for learning any application programming language (2) QUOTE The best way to learn programming is to dive right in and start writing real programs.
This way, concepts which would otherwise seem abstract make sense, and the positive feedback you get
from getting even a small program to work gives you a great incentive to improve it or write the
next one. Diving in with ``real'' programs right away has another advantage, if
only pragmatic: if you're using a conventional compiler, you can't run a fragment of a
program and see what it does; nothing will run until you have a complete (if tiny or trivi....
Dos Programming, Undocumented Dos, And Dos Secrets
(3) This web site is devoted to DOS programming for those of us who still enjoy programming in DOS some
of its containt are Disk/Files - Programming the disk and/or file info. DOS - DOS programs, DOS
prompt, DOS compilers, etc. Encryption/Compression - Encryption and Compression. Games - Programming
Games. Hardware/System programming - Memory, BIOS, CMOS, and other Hardware/System items.
Input/Output Devices - Mice, Joystick, Keyboard, Modem, Printer, etc.. Misc - Item that don't
fit in any/all the other subjects. Sound - Sound programming Video/Graphics - Graphics progr....
Dos Game Programming In C For Beginners
(1) There are a number of tutorials available for the intermediate game programmer, but there are very
few good tutorials for beginners who have never drawn a pixel on the screen. A quick search on the
net reveals hundreds of sites devoted to 3D, polygons, texture- mapping and other advance topics,
but the beginner has no where to get started. This tutorial is for C programmers who want to get an
introduction to game programming. find this tutorial at Dos Game Programming in C for Beginners
....
256-color Vga Programming In C Site
(0) what some say is the best VGA programming site on the web VGA Basics Setting the video mode,
plotting a pixel, and mode 0x13 memory. Primitive Shapes & Lines Drawing lines, polygons,
rectangles, and circles. Also, Bresenham's algorithm, fixed-point math and pre-computing tables.
Bitmaps & Palette Manipulation The BMP file format, drawing bitmaps, and palette manipulation. Mouse
Support & Animation Animation, mouse motion, and mouse button detection. Double Buffering, Page
Flipping, & Unchained Mode Double buffering, page flipping, structure of unchained mode,....
Win32: Dialog Box And Accelerator
Win32 API programming (2) ok my problem is how do i make or assign a keyboard accelerator with modal dialog boxes since the
message loop is inside the function call of DailogBox() functions, unlike the modeless dialog box in
which you are the one who will create the message loop for the dialog box... is it even possible?....
Dynamic Memory Allocation
(2) I'm writing a didactic software that can store an undefined number of int in a dynamic list. I
wrote a routine too that can delete an int and point the previous node to the next node after the
one I've deleted. But I've a problem: If I try to delete a number that isn't in the
list, software crashes! Why? If the routine doesn't find the number it should simply do
nothing CODE #include <stdio.h> #include <stdlib.h> void crealista();
void visualizzalista(); void eliminanumero(); struct elenco { int ....
Programming A Malloc
(1) A little background about what I am doing is this: I have an array which holds a linked list
containing the memory that is currently taken from the system. Each index I have like 16 size
memory or less can be stored only in index 0, index 1 is for memory inbetween 16-32, index 2 is for
memory inbetween 32-64, etc all the way up to 2048 which is the max allocatable memory. Now the way
my malloc is to work is that it first will run through my list to see if any memory is available
that is greater than or equal to the size I need, if there is any at all it will return it....
Where To Start Learning C++ Programming Language
Resources for C++ (4) I'm planning on learning c++ but I'm having some problems. First, I need a compiler.
I've downloaded Digital Mars (www.digitalmars.com) but how the heck do I compile something????
There's this other free compiler that loooks great but seems hard to install. Does anyone know a
good freeware compiler??? Also does anyone know what some good tutorial resources are? I've
found a few sites, but does anyone know a really good one? Or maybe a good book? But my main
problem is with the compiler. Can't get anything done without one.......
Never Ending Books For C++ Programming
C++ Programming Books (3) /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Hello Friends As I m
doing MCA so I have so many ebooks for u. Anybody that wants C++ Programming Knowledge ,can get from
these books,it includes all basic and expert features programming.So here is the collection Only For
Trap17 Users.If u like this Post Please reply. Thanx ....................
Vesa Programming Viewer In D O S
Graphics in C/C++ (3) Hello friends, I wanna make an image viewer in DOS...can any one help me how to deal with high
resolution screens in DOS uning mouse using VESA interrupts. Please help.. thanks acumentech....
Vesa Programming Viewer In C
Graphics in C (2) Hello friends, I wanna make one image viewer program in C please help me how to deal with high
resolution video using VESA programming. Thanks acumentech....
Life In Programming?
wheres this headed? (11) Hey guys im 16 and really like programming (although im fairly new at it) ive already taken a year
of basic html and what not. This year im taking a class in c++ and VB next year i hope to take java
and php. However next year will be my senior year and i will have to start applying for colleges
and im trying to convince my parents that there ARE jobs in computers its hard for them to do this
they like to stay locked up in there own little world **cough cough** stone age **cough** so what i
was wondering is what jobs are actually out there for this kinda stuff what are ....
Programming Help
(7) Hi there, I have C++ programming in my college syllabus this semister.Once this paper+ Oral exams
over i think i may loose touch with C++. Can you suggest me any good forum where i can keep in touch
with C++.Any project where i can keep my creative juices flowing? PLs can you help me with this.....
Directed/undirected Graph Structures
A discussion on the topic. (1) On off-shoot of another topic: QUOTE(hcwindclub) I am sorry to ask that where I can find any
information about implementation of mesh network topology? but easy to use? I am not familiar with
the concept of "template" so what I found at Google is too difficult to absorb in a short time, and
I need to finish my assignment at school in one month. Right now, I can't decide which data
structure to implement topology, in order to easily search link such that I would know how many
nodes neighbor a target node and which one sends and which one receives? especially when....
Where Can I Learn Linux Programming?
any good resources for linux programming (2) Where can i learn linux system programming? Topic titles and descriptions are important. Try and
make them as descriptive as possible. Linux Programming, Linux is not very descriptive. Renamed.
....
Good Books On C++ Game Programming
I need some books! (2) I am looking for some good books on game programming in c++ if any body out there has any
suggestions feel free to post them. Oh by the way should i start out with an easier language like
BASIC or should I just work on c++. Ineed some help people please reply fast. Tahnx
David H /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> ....
Game Programming
(17) I'm looking into going into game programming and I want to know if there is another programming
language I should learn to go along with C++? Or should I just learn C++(Master Blaster of C++,
Master Shake of C++, Lord and Master of C++, Jedi Master of C++) and then learn(more)/master it in
college? Thanks, Kvarner express....
D Programming Language
(9) hi friends, surprised... was that a type???? It is not a type... I know this is a C/C++
programming language forum.. Just wanted to share something I came across today... A new
programming language based on C and C++ is being developed.. It would have all the power of C/C++,
in other words as the spec says "retains the ability to write high performance code and interface
directly with the operating system API's and with hardware." The specification of the language
and alpha phase compilers are available at www.digitalmars.com I just browsed throught the spec a....
C Most Popular Programming Language
Look at title :) (3) http://www.tiobe.com/tiobe_index/tekst.htm C is most popular programming language altought market
share is ~2 %. The most projects is worked in other programming language like .NET and C++. I think
C is too old. What do you think?....
A Question About C++ Programming Under Linux
(7) Hello guys! i prepare to develop under linux using c++, but i don't know what tools i should
use...some one tell me to use vim, but i think vim is so hard to use!can u recommend me some
ide??? thank u very much....
Looking for discussion, dynamic, programming
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for discussion, dynamic, programming
*MORE FROM TRAP17.COM*
|
advertisement
|
|