<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>731 - 面試問題收集 on 嗡嗡的隨手筆記</title>
        <link>https://wongwongnotes.com/categories/731---%E9%9D%A2%E8%A9%A6%E5%95%8F%E9%A1%8C%E6%94%B6%E9%9B%86/</link>
        <description>Recent content in 731 - 面試問題收集 on 嗡嗡的隨手筆記</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>zh-tw</language>
        <copyright>嗡嗡</copyright>
        <lastBuildDate>Sat, 29 Apr 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://wongwongnotes.com/categories/731---%E9%9D%A2%E8%A9%A6%E5%95%8F%E9%A1%8C%E6%94%B6%E9%9B%86/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>【面試準備 #1】經典問題收集 - 說明 tree, graph 的差異?</title>
        <link>https://wongwongnotes.com/posts/algorithm-practice/interview-prep/740---%E9%9D%A2%E8%A9%A6%E5%95%8F%E9%A1%8C%E6%94%B6%E9%9B%86/interview-tree-graph/</link>
        <pubDate>Sat, 29 Apr 2023 12:21:53 +0800</pubDate>
        
        <guid>https://wongwongnotes.com/posts/algorithm-practice/interview-prep/740---%E9%9D%A2%E8%A9%A6%E5%95%8F%E9%A1%8C%E6%94%B6%E9%9B%86/interview-tree-graph/</guid>
        <description>&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;
&lt;p&gt;這裡收集一些我從朋友身上聽到一些不錯的面試問題，&lt;br&gt;
第一次碰到可能會比較慌亂，不見得能漂亮的直接答出來，&lt;br&gt;
這裡紀錄一下。&lt;/p&gt;
&lt;h2 id=&#34;問題&#34;&gt;問題&lt;/h2&gt;
&lt;p&gt;請說明 tree, graph 的差異?&lt;/p&gt;
&lt;h2 id=&#34;參考回答&#34;&gt;參考回答&lt;/h2&gt;
&lt;p&gt;tree 跟 graph 確實很像，但我們可以當作 tree 是一種特化後的 graph，&lt;br&gt;
graph 可以包含更多種可能，而 tree 可以專門處理特定的問題&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;tree，會有 parent, child 的上下概念，graph 沒有 (每一個 node 同地位)&lt;/li&gt;
&lt;li&gt;tree，有向性 (有上下關係)，graph 不一定有向 (單向雙向都可以)&lt;/li&gt;
&lt;li&gt;tree，有 root，graph 沒有 root&lt;/li&gt;
&lt;li&gt;graph，可以有循環，tree 那是不可能的XD&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;總之，graph 能廣泛處理各種種類的問題，而 tree 是專門處理有著特定關係的問題。&lt;/p&gt;
&lt;!--
Post ID: 8674
Post Date: 2023-04-29 12:21:53
Categories: 740 - 面試問題收集
Tags: 740 - 面試問題收集, git, 740, 面試問題收集
--&gt;
</description>
        </item>
        
    </channel>
</rss>
