Skip to content

vanshika-verma14/21DaysOfCode-2024

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Questions for Day 15 – (05/07/2024)

DSA:

Question 1: Write a function to determine the height of a binary tree. The height is defined as the number of edges between the root and the furthest leaf.

Inputs:
  • The root node of the binary tree.
Output:
  • The height of the tree.
Example:
Binary Tree:
      3
     / \
    2   5
   /   / \
  1   4   6
Output: 2

Question 2: Implement a function to perform a level order traversal (breadth-first traversal) on a binary tree.

Inputs:
  • The root node of the binary tree.
Output:
  • The values of the nodes in level order.
Example:
Binary Tree:
      3
     / \
    9  20
       / \
      15  7
Output: [3, 9, 20, 15, 7]

WEB-DEV:

  1. Create a React component called ButtonClicker that displays a button. When clicked, the button should change its text from "Click me" to "Clicked!".
  2. Create a React component called LikeButton that displays a button labeled "Like". When clicked, it should increment a count displayed next to the button indicating how many times it's been clicked.
  3. Create a React component called TrafficLight that displays a traffic light with three colors: Red, Yellow, and Green. Implement a button that toggles the state of the traffic light (Red -> Green -> Yellow -> Red).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 30.7%
  • Java 28.5%
  • C 17.0%
  • C++ 13.7%
  • CSS 5.3%
  • Python 3.7%
  • Other 1.1%