Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dedup.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ struct Trie {
} *root=NULL;

char merge(struct Trie *p) {
// missing child
if(!p) return 0;
// this node is marked
if(p->flag) return 1;
// missing either child
if(!p->child[0]||!p->child[1]) return 0;
// true when both true;
return (p->flag = merge(p->child[0]) && merge(p->child[1]));
return (p->flag = merge(p->child[0]) & merge(p->child[1]));
}

void print(struct Trie *p, unsigned depth) {
Expand Down