| | |
Stacks and trees
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
@JONZ
Your question doesn't specify your need correctly.Well I could frame two questions out of it. So answering them.
1)How to create stacks and trees?
Stacks can be created using many methods. By Arrays, using a variable to act as top indicator. By Linked List, using a node pointer to act as top indicator.
2)Where can you apply stacks and trees?
Stacks can be applied for various applications.
Ex : Reversal of a string.
Trees are applied where ever solution to the problem needs branching of decisions at various levels according to requisites.
Ex : T9 dictionary in mobiles.
Your question doesn't specify your need correctly.Well I could frame two questions out of it. So answering them.
1)How to create stacks and trees?
Stacks can be created using many methods. By Arrays, using a variable to act as top indicator. By Linked List, using a node pointer to act as top indicator.
2)Where can you apply stacks and trees?
Stacks can be applied for various applications.
Ex : Reversal of a string.
Trees are applied where ever solution to the problem needs branching of decisions at various levels according to requisites.
Ex : T9 dictionary in mobiles.
I Surf in "C"....
•
•
Join Date: Nov 2008
Posts: 32
Reputation:
Solved Threads: 1
There also an important use of Trees in gaming Applications like in a Football game the movement of a Player is actually implemented using Trees by moving in huge number of nodes beside each other this technique makes the player's movement more flexible .
•
•
Join Date: Nov 2008
Posts: 32
Reputation:
Solved Threads: 1
I don't think so, since the Mine Sweeper will use two Dimensional array as a Data Structure to assign a random number of mines in random cells.
But i think tress can be used implicitly by implementing recursive functions.
That's my thoughts
.
But i think tress can be used implicitly by implementing recursive functions.
That's my thoughts
. Ya I too agree with Ahmed_I that Minesweeper just uses a two dimensional array with mines generated at random.
Then a program is run which takes the present cell co-ordinates and calculates number of mines in all adjoining cells and writes a number equal to number of mines around it.
The later part of clicking and all can be done through some other methods.
Then a program is run which takes the present cell co-ordinates and calculates number of mines in all adjoining cells and writes a number equal to number of mines around it.
The later part of clicking and all can be done through some other methods.
I Surf in "C"....
Well SCRABBLE would be the best example I suppose.When the computer plays with its set of letters it branches out and tries all possibilities to make a word which is there in the process of branching and trying for new words trees are used... Because they would be the best way to try out things.
I Surf in "C"....
Checkers would be a good example. It would be a decent way to make an "AI" for it. Use trees to see all possible outcomes of a certain move, compare that with all the other outcomes to see the best move. (adding a limitation on the depth of analysis might be appropriate for speed/difficulty purposes)
![]() |
Similar Threads
- Suffix trees and suffix arrays (C)
- hello i have a problem (VB.NET)
- getting an statement (C)
- C++ Books (C++)
- How did you learn C++? (C++)
- Stacks and Queues (C++)
- Data Structures (C)
- problem in creating a tree (C)
- Computer Science (IT Professionals' Lounge)
- Beyond C++ console program.. (C++)
Other Threads in the C Forum
- Previous Thread: Alternative to ShellExecute
- Next Thread: Reading values from a file in C
| Thread Tools | Search this Thread |
#include adobe ansi array arrays asterisks binarysearch calculate centimeter changingto char convert copyimagefile cprogramme creafecopyofanytypeoffileinc csyntax database directory dynamic fflush file fork forloop framework frequency getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware highest histogram inches include incrementoperators input iso kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard multi mysql number opendocumentformat opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf scripting segmentationfault sequential shape socket socketprograming stack standard string strings structures systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi





