RE: trees?

  • From: "Homme, James" <james.homme@xxxxxxxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 21 Oct 2010 10:44:51 -0400

Hi Laura,
I don't know, but right now, I'm frustrated because I need to know so much. 

Jim

Jim Homme,
Usability Services,
Phone: 412-544-1810. Skype: jim.homme
Internal recipients,  Read my accessibility blog. Discuss accessibility here. 
Accessibility Wiki: Breaking news and accessibility advice


-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
Sent: Thursday, October 21, 2010 8:42 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: trees?

Hi Jim --
No I haven't read that book, but the implementation of stacks in any OO 
language will be similar, with mostly only syntax changes and error recovery 
added -- that is, if only the OO features are used...
Perhaps I shouldn't speak without implementing a stack in more than 2 
languages...*smile*

As for this book, it sounds like a good read if it covers how to implement 
all the various data structures -- lists, stack, queues, deques, trees, hash 
tables, etc, in all their varieties, and which implementations are better 
for what applications.
A CS major nowadays I assume learns these concepts early before moving on to 
more advanced topics, which rely heavily on knowledge of these types of 
basic data structures.
Back in the stone age of the 80s, it was an undergrad course, so I assume 
now it is covered earlier than that... am I right?
It's not all that hard, but like Harry Potter charging through the cement 
wall then looking back to see the entry door, you have to try it and work on 
it before you get it internalized.
(Excuse the reference to Harry Potter -- I read one of the books and may or 
may not finish, but they contain some interesting thoughts.)
Happy hacking.
--le


----- Original Message ----- 
From: "Homme, James" <james.homme@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, October 21, 2010 7:08 AM
Subject: RE: trees?


Hi Laura,
Speaking of stacks and such, if you've seen the file Thinking Like A 
Computer Scientist Learning with Python from 
http://openbookproject.net/thinkcs/python/english2e/index.html, do you think 
it's good to work with it? I came up in the days when you didn't have to 
have a programming degree. There are a lot of holes in my programming 
knowledge.

Thanks.

Jim

Jim Homme,
Usability Services,
Phone: 412-544-1810. Skype: jim.homme
Internal recipients,  Read my accessibility blog. Discuss accessibility 
here. Accessibility Wiki: Breaking news and accessibility advice


-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
Sent: Thursday, October 21, 2010 7:54 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: trees?

Hi Alex -- I just now read this thread -- hopefully this can shed some
light.

Are you familiar with implementing stacks? stacks and trees go hand-in-hand,
and to answer your question of how backtracking relates to trees, whenever
you pop the stack you are backtracking.  Why is that? because presumably
when you pop the stack you have either found your solution to that query, or
you haven't found it yet but have exhausted all the paths within that stack
level.
I think sometimes concepts are easy to understand but hard to translate into
code for someone just learning to program.  It is true that the idea of a
tree is something we all encounter every day, but the implementation details
can throw you.
I am confident you can solve it however.
Good luck and if you have any questions, I join my name to the others who
volunteer to talk it out -- my skype id is leavesplusplus.
--le




----- Original Message -----
From: "Alex Hall" <mehgcap@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, October 20, 2010 5:03 PM
Subject: Re: trees?


That is what the professor said. However, I fail to see how the
algorithm moves backwards, and other code-specific concepts, and the
professor only explains in terms of a tree... I will have to meet with
her Friday if Friday's class does not clear anything up.

On 10/20/10, Hamid Hamraz <hhamraz@xxxxxxxxx> wrote:
> Hi,
> The algorithm for the 8-queen problem may do this:
> First consider each node of the tree as a representation of a state of the
> board. For example, the root node is representing a chess board with a
> queen
> in the cell (1,1), that is the top left cell. Let's say that the algorithm
> is smart enough not to place the second queen in the same row. next step
> is
> to produce the first child node of the root, which represents a chess
> board
> with the first queen at (1,1), and the second one, in (2,1). That is a
> conflict, so the algorithm backtracks to the root and span another child
> of
> the root,which is a chess board with the second queen in (2,2). again
> conflict, and the algorithm should backtrack to the root. It does this
> until
> it finds a none-conflicting state for row 2. and then it moves forward to
> the 3rd row and so on. sometimes the algorithm may need to backtrack more
> than one level.
> please note that the algorithm is not allocating memory for the whole
> tree,
> it only needs to keep track of the current working state. If you look to
> what algorithm is doing as a whole, you can conceptualize a very big tree
> with a 8 to the power of 8 nodes, each of them representing a chess board
> with 1 to 8 queens placed, each in one row, conflicting or not. The
> mission
> of the algorithm is to crawl among the various nodes of the tree until it
> finds a leaf node without any conflict. that is the 8 queens are placed
> there in a none-conflicting situation. If the algorithm continues crawling
> it can find 92 different solutions for the problem, among the huge search
> space of 8 ^8 states.
> This may look too much information, but when you understand it then it is
> easy and it becomes a solid basis for similar problems, that are arising
> very often in computer sciences.
> Last but not least, I just wanted to relate the concept of the trees to a
> solutionof mine. The algorithm at your hand may be different. It may be
> more
> heuristical or may be sillier. But the concept of the tree, as a
> representation of the search space is similar.
> HTH
> Hamid
> ----- Original Message -----
> From: "Alex Hall" <mehgcap@xxxxxxxxx>
> To: <programmingblind@xxxxxxxxxxxxx>
> Sent: Wednesday, October 20, 2010 6:49 PM
> Subject: Re: trees?
>
>
>>I get the concept, but that does not help me relate what the code is
>> doing with the tree (where, exactly, it is in the tree, why it stops
>> at a certain point, where it goes back to...)
>>
>> On 10/20/10, Client Services <Operations@xxxxxxxxxxxxxxx> wrote:
>>> Don't get very caught up in the drawing.
>>> I think you grasp the concept already.
>>> A tree with multiple branches and sub branches.
>>> Create your own picture in your mind.
>>>
>>> H.R. Soltani
>>>
>>> -----Original Message-----
>>> From: programmingblind-bounce@xxxxxxxxxxxxx
>>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
>>> Sent: Wednesday, October 20, 2010 10:54 AM
>>> To: programmingblind@xxxxxxxxxxxxx
>>> Subject: Re: trees?
>>>
>>> In this case, I am talking about a tree os possibilities, where the
>>> root is where you start and each of the root's children can have 0 or
>>> more subtrees of their own... You see why this is so hard to represent
>>> in an accessible way.
>>>
>>> On 10/20/10, Phil Vlasak <pcsgames@xxxxxxxxxxx> wrote:
>>>> Hi Alex,
>>>> In an architecture plan, a tree is a circle with a dot at the center.
>>>> The
>>>> point represents the center of the trunk, and a circle represents the
>>>> average distance the branches reach out.
>>>>
>>>> ----- Original Message -----
>>>> From: "Alex Hall" <mehgcap@xxxxxxxxx>
>>>> To: "programmingblind" <programmingblind@xxxxxxxxxxxxx>
>>>> Sent: Wednesday, October 20, 2010 10:32 AM
>>>> Subject: trees?
>>>>
>>>>
>>>>> Hi all,
>>>>> We are doing trees in an algorithms class I am taking. The assignment
>>>>> coming up is the "n queens" problem, where you have an n by n board
>>>>> and must place n queens on the board such that no two queens share the
>>>>> same row, column, or diagonal line. To "help" explain this, the
>>>>> professor is using a tree on the board. I am completely confused! She
>>>>> says I do not need to think of it in terms of trees, yet the only way
>>>>> she explains it is in tree terms, so I am not sure what she is talking
>>>>> about. Of course I know about trees, but when she tries to explain how
>>>>> the code we are looking at relates to the tree in terms of what the
>>>>> code is supposed to do, I haven't a clue as to what she is trying to
>>>>> say. Does anyone have any thoughts on how to represent trees, whether
>>>>> in braille or speech, or a good notation/substitute for a tree? TIA.
>>>>>
>>>>> --
>>>>> Have a great day,
>>>>> Alex (msg sent from GMail website)
>>>>> mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
>>>>> __________
>>>>> View the list's information and change your settings at
>>>>> //www.freelists.org/list/programmingblind
>>>>>
>>>>
>>>>
>>>>
>>> ----------------------------------------------------------------------------
>>> ----
>>>>
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 9.0.862 / Virus Database: 271.1.1/3207 - Release Date:
>>>> 10/19/10
>>>> 14:34:00
>>>>
>>>> __________
>>>> View the list's information and change your settings at
>>>> //www.freelists.org/list/programmingblind
>>>>
>>>>
>>>
>>>
>>> --
>>> Have a great day,
>>> Alex (msg sent from GMail website)
>>> mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
>>> __________
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/programmingblind
>>>
>>> __________
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/programmingblind
>>>
>>>
>>
>>
>> --
>> Have a great day,
>> Alex (msg sent from GMail website)
>> mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>


--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


This e-mail and any attachments to it are confidential and are intended 
solely for use of the individual or entity to whom they are addressed.  If 
you have received this e-mail in error, please notify the sender immediately 
and then delete it.  If you are not the intended recipient, you must not 
keep, use, disclose, copy or distribute this e-mail without the author's 
prior permission.  The views expressed in this e-mail message do not 
necessarily represent the views of Highmark Inc., its subsidiaries, or 
affiliates.
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: