SAX Parser | DOM Parser |
---|---|
It is event based. Fires an event when it encounters opening tag, or element attribute. | Document Object Model. Creates in-memory tree representation of XML files and then parses them. |
Good for large files because it reads large files in small parts. | Good for small files since entire XML is loaded in the memory. |
Need to implement more methods for parsing. | It has good implementation of different parsing. |
Stack V/s Heap
Stack
|
Heap
|
Allocation of memory is static in stack. | Allocation of memory is dynamic. If more memory is needed more space is allocated and vice-versa. |
Each thread gets its own stack. | An application gets a heap of memory. |
Scope of stack is till the thread execution. Once thread exits, stack is reclaimed. | Heap is reclaimed once the application exits. |
It is faster since allocation and deallocation of memory is faster. | The allocation and deallocation of memory is slow in case of heap. |
Once a function returns, stack is discarded. | Destructed manually or is Garbage collected. |
Primitives are stored on stack, pass by values are also stored on stack. | Objects are stored on heap. |
Trie v/s BST
Trie
|
Binary search tree
|
Lookup is O(m) | Lookup is O(logn) |
Storage space is less because node share the content. | Nodes doesn’t share the content. |
Number of internal nodes equals key length. | It doesn’t depend on key length, instead it depends upon what order the keys appear. |
Primary Key v/s Unique Key
Primary Key
|
Unique key
|
Primary keys are indexed by clusters. | Their index is not clustered. |
Primary constraint is applicable. | Unique constraint on a column of the table. |
Only one per table. | A table can have more than 1 unique keys. |
Could be combination of unique keys. | Cannot be a combination of different keys. |
You might also like:
Find White Spaces in Character Array
Find a character in the String
Number is prime or not
Finding Absolute Value
Notes on Sorting and Searching Algorithms
Common String Functions
Reverse a String
Product of all array location expect its own
Find a cycle in the Linked List
Find a binomial co-efficient
Remove duplicates from the array
Counting sort algorithm
B-Tree
Find a character in the String
Number is prime or not
Finding Absolute Value
Notes on Sorting and Searching Algorithms
Common String Functions
Reverse a String
Product of all array location expect its own
Find a cycle in the Linked List
Find a binomial co-efficient
Remove duplicates from the array
Counting sort algorithm
B-Tree
Your topics are interesting. Keep posting. :)
ReplyDeleteThank you :) Sorry just noticed the comment.
Delete