Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Dsa notes

Rating
-
Sold
-
Pages
3
Grade
A
Uploaded on
21-01-2025
Written in
2024/2025

Yes this notes are help to exam and achieve best marks in your exam

Institution
Course

Content preview

1.What is Complete Binary Tree?
Ans.A Complete Binary Tree is a binary tree in which:


1. All levels are fully filled, except possibly the last level.
2. The last level is filled from left to right.


Properties:


1. Every node has 0 or 2 children.
2. All internal nodes have two children.
3. All leaf nodes are at the same level.


Types of Complete Binary Trees:


1. Perfect Binary Tree: All levels are fully filled.
2. Almost Complete Binary Tree: Last level has one or two nodes missing.

Examples:

``` 1
/ \
2 3
/ \ / \
4 5 6 7

Complete Binary Trees are used in:

1. Heaps
2. Priority Queues
3. Binary Search Trees (BSTs)
4. Data Compression



2.Different between array and queue.
Ans.Array:-
An Array is a collection of items stored at contiguous memory locations. The idea
is to store multiple items of the same type together. This makes it easier to
calculate the position of each element by simply adding an offset to a base value,
i.e., the memory location of the first element of the array (generally denoted by
the name of the array).
The diagrammatic representation of the Array is given below:
______________________________________
40|55|63|17|22|68|89|97|89|
______________________________________
0 |1 | 2 | 3 | 4 | 5| 6| 7|8. |<=array indices
Array length -9
First index-0
Last index-8

Queue:-
A Queue is a linear structure that follows a particular order in which the
operations are performed. The order is First In First Out (FIFO). A good example of
a queue is any queue of consumers for a resource where the consumer that came first

Written for

Institution
Course

Document information

Uploaded on
January 21, 2025
Number of pages
3
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$7.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
shringihimanshu58

Get to know the seller

Seller avatar
shringihimanshu58 Rajasthan technical university
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions